How can i add discount on Paypal Checkout Form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, This is Muaz <removed>, PHP Developer. I'm working a client named Simridha, Paypal user/client. Basically i'm developing their e-commerce website i.e. https://colormaxcosmetics.com/
I need to add my concern that I have used your service in checkout user. But i am facing a minor issue. I am trying to add discount option on my checkout form. But this functionality is only working on single cart item. I want to add discount even when user buys more than 1 product. Thank You in advance. Looking forward for your positive response.
<form action="<?php echo $paypalURL; ?>" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="<?php echo $paypalID; ?>">
<?php $i=0; foreach($this->cart->contents() as $items123){ $i++; ?>
<input type="hidden" name="item_name_<?php echo $i; ?>" value="<?php echo $items123['name']; ?>">
<input type="hidden" name="amount_<?php echo $i; ?>" value="<?php echo $items123['price']; ?>">
<input type="hidden" name="quantity_<?php echo $i; ?>" value="<?php echo $items123['qty']; ?>">
<?php } ?>
<input type="hidden" name="first_name" value="" id="paypal_first_name">
<input type="hidden" name="last_name" value="" id="paypal_last_name">
<input type="hidden" name="shipping_1" value="" id="paypal_shipping">
<input type="hidden" name="tax_cart" value="" id="paypal_tax">
<input type="hidden" name="discount_amount" value="2.00">
<input type="hidden" name="undefined_quantity" value="1">
<input type="hidden" name="city" value="Berwyn" id="paypal_city">
<input type="hidden" name="email" value="" id="paypal_email">
<input name="address1" type="hidden" value="<removed>">
<input type="hidden" name="return" value="https://clients.innovativecloudsolutions.co/colormax-new/test/success">
<button id="btn_order" type="submit" style="display:none" class="btn rd-3d-btn dart-btn-sm dart-fright">Place Order</button>
</form>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Discount Variables listed below are intended to work with Buy Now Buttons and Add to Cart Buttons. They only apply to the item they are associated with, "not" the entire shopping cart. This means that you can "only" apply a Discount to an individual item and they do not apply to Taxes or Shipping.
discount_amount
discount_amount2
discount_rate
discount_rate2
discount_num
The following Discount Variables will only work with the "Upload" Method.
discount_amount_cart - Applies to entire cart. **
discount_amount_x - Applies only to the individual item.
discount_rate_cart - Applies to entire cart. **
discount_rate_x - Applies only to the individual item.
Bottom line - you would need to use the "upload" method in order to apply a discount to the entire cart. See the details here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Getting errors when integrating standard checkout with my web site. Probably a beginner problem. in SDKs
- Need help to integrate Advanced Checkout (PPCP) With WHMCS in PayPal Upgrade Community
- Need help to integrate PayPal Checkout with Ecwid in PayPal Upgrade Community
- Change the button from Sandbox to Production in PayPal Payments Standard
- Mandatory Account Creation Hindering Customer Experience in REST APIs