cancel
Showing results for 
Search instead for 
Did you mean: 

Add Multiple Products to Cart, along with Product Option(s)

Options
39steps
New Community Member
Posted on

Hello

 

I currently have a solution for adding multiple items to a cart, with varying quantities and prices, using the following code (see below), and would like to add an option for a personalised message, which shows up as part of the PayPal order, perhaps as a separate (non-chargeable?) item.

 

I've tried the on0 and os0 variables, etc., but to no avail. Any ideas? I would like, if at all possible, to keep all the order details in PayPal (rather than complicate things by separately storing the personalised message product option on the client website).

 

<form action="https://sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top" id="buynow">
<input type="hidden" name="business" value="my[at]business.com">

<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="currency_code" value="GBP">

<!-- gift voucher 5 -->
<input type="button" value="-" class="qtyminus btn btn-default" field="quantity_1">
<input type="text" name="quantity_1" value="1" class="qty form-control">
<input type="button" value="+" class="qtyplus btn btn-default" field="quantity_1">
<input type="hidden" name="item_name_1" value="5 GBP voucher" id="item_name_1">
<input type="hidden" name="amount_1" value="5.00" id="item_amount_1">

<!-- gift voucher 10 -->
<input type="button" value="-" class="qtyminus btn btn-default" field="quantity_2">
<input type="text" name="quantity_2" value="0" class="qty form-control">
<input type="button" value="+" class="qtyplus btn btn-default" field="quantity_2">
<input type="hidden" name="item_name_2" value="10 GBP voucher" id="item_name_2">
<input type="hidden" name="amount_2" value="10.00" id="item_amount_2">

<input type="submit" value="Buy with PayPal">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>

 

Any help would be greatly appreciated.

 

Cheers

Liam

1 REPLY 1

Add Multiple Products to Cart, along with Product Option(s)

Options
MTS_Andre
Moderator

Hi, what you could do is to add a text field that would be the description or personalised message and then concatenate to the item_name like for example: "10 GBP voucher - Happy Anniversary Joe" where the last part after the "-" has been concatenated from the text field. You can eventually check via Javascript if any possible way to achieve that.

Haven't Found your Answer?

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