• 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: PayPal Promo Code Script

PayPal Promo Code Script 7 years 1 month ago #36532

I am trying to add a textbox that allows users to add a promo code to receive a 10% discount on purchases. After researching the forum, I found the two scripts below but neither has proven successful.

I added each script to the Scripts > PHP Scripts > Scrip called on form process section. I did not include the PHP tags. I tried the first, then I removed that one and tried the second. Neither worked. What am I doing wrong?
if ($_POST['form']['promo'] == 'test'){
  $paypal = RSFormProPayPal::getInstance();
  $paypal->args['discount_rate'] = 10;
}
$amount=$_POST['form']['rsfp_Total']; 
if($_POST['form']['promo'] == 'test')
   $_POST['form']['rsfp_Total'] = $amount - ($amount * 0.1);

Website: gdf.jxngraphix.com/applications
Last Edit: 7 years 1 month ago by JxnGraphix.
The administrator has disabled public write access.

PayPal Promo Code Script 7 years 1 month ago #36540

The issue has been resolved and the first script is working properly. I edited it to check for multiple statements. It checks if the correct promo code [Promo] has been entered and if a dropdown box selection [Dancers] is greater than or equal to 10. If both statements are true, it provides a 15% discount at checkout.
if ($_POST['form']['Promo'] == 'PROMO' && $_POST['form']['Dancers'][0] >= '10') {
  $paypal = RSFormProPayPal::getInstance();
  $paypal->args['discount_rate'] = 15;
}

One thing that would make this better if the discount were automatically reflected instead of it showing after the user is directed to PayPal. Other than that, its great.
Last Edit: 7 years 1 month ago by JxnGraphix.
The administrator has disabled public write access.

PayPal Promo Code Script 7 years 1 month ago #36552

One more issue...the discount is applied to the total price, not the specified item. For instance, if a user purchases 10 shirts and 5 pairs of pants, they will receive a 15% discount on the full order. The intention of the Promo Code is to allow the user to receive a discount for the specific item they purchase 10 of. If anyone knows how to implement this, feedback is appreciated...
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!