• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Limit Number of Form Submissions PayPal Status

Limit Number of Form Submissions PayPal Status 4 years 6 months ago #40631

Hey there. I was wondering if anyone has come across a solution to limit the number of form submissions WHERE the PayPal status is set to Accepted?

I've looked though the Forum and Help Topics and have come across only one item which almost fits the bill:
Example 4: Limit the number of submissions to a form

The form process I have is as follows:
  1. User completes the form to purchase a raffle ticket, for example.
  2. When selecting the Submit button, they are taken to a PayPal page to complete payment (counter is now incremented by one). It's at this point where the user can either drop the session or hit the cancel button; if this happens, my counter is now incorrect and the PayPal status would show as Pending instead of Accepted.

I was looking to the database and saw a submission_value table, however, I'm uncertain how to perform the following:

SELECT COUNT ('SubmissionId') FROM #__rsform_submission_value WHERE 'FormId'='".(int) $formId."'" AND
(now pseudocode)
FieldName ('_STATUS') = 1

I'm simply trying to say if the FieldName of STATUS is set to 1 (Accepted by PayPal), then include this result in the count.

I suspect there's an INNER JOIN required here, but I'm uncertain how to proceed.

I hope this makes sense...I may be making things more difficult than they need to be, but I'm hoping someone may have come across a similar situation and has a solution?

Thanks!
The administrator has disabled public write access.

Limit Number of Form Submissions PayPal Status 4 years 6 months ago #40653

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

You don't necessarily need to join tables in your query (at least under these particular circumstances as you could count unique submissions with your needed values), though as a example this can be specified as:
$db->setQuery("SELECT COUNT(s.`SubmissionId`) FROM #__rsform_submissions AS s LEFT JOIN #__rsform_submission_values AS sv ON s.`SubmissionId`=sv.`SubmissionId` WHERE s.`FormId`='".(int) $formId."' AND sv.`FieldName`='_STATUS' AND sv.`FieldValue`='1'");
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.
The following user(s) said Thank You: albertasky

Limit Number of Form Submissions PayPal Status 4 years 6 months ago #40671

Fantastic! Works like a charm...thanks so much :)

Tim
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!