0
votes

I created a Paypal checkout button using their interface. I have a list of items on my website with their titles and prices and quantities. How can I dynamically send this information to Paypal so that the users see the list of items that they have chosen on the Paypal checkout page without having to manually put each item one by one in the button management page on the Paypal website.

PS. Also, I don't want to add a Add to Cart button for each item.

Thank you in advance for any help.

1

1 Answers

0
votes

You just need to pull the data from your database or whatever source you have all of the different details and then load them into the PayPal button code. For example:

$price = $db->record->price; // Some dynamically loaded price value.

Then in the HTML for the button you would do something like this:

<input type="hidden" name="amount" value="<?php echo $price; ?>" />

Of course, you would just do that for every field you want to dynamically load in the HTML.