I need to create a Pay Now / Buy Now button that retrieves a price from a simple shopping cart.

coconghaile
Contributor
Contributor

I have a very simple shopping cart on my website. I'm only selling one item but you can add a quantity of the item to your cart. The final price will and can differ for each customer. I want to add a Pay Now / Buy Now button to the end of the shopping cart that picks up of the price in the shopping cart, and when you press the PayPal button, it re-directs you to pay with PayPal with the right amount from the cart. 

I tried creating a simple Buy Now / Pay Now button and adding this line (<input type="hidden" name="amount" value="<?= number_format($discountedPrice, 2); ?>">) to it but no joy. I looked at the PayPal Developer portal but I'm not the best coder and wasn't sure what to do. Can someone help point me in the right direction please. 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.