Need multiple options displayed on check out page

alinart
Contributor
Contributor

When items are added to the cart... only the first option (no matter which one it is) displays on checkout. 
I'm using just a simple javascript integration for paypal. No PHP. 

When the customer checks out, there is no indication of what size or color they chose despite having those options available. How can I get more than just the first option to display? I tried adding the option variables that I found in the developers section of paypal but it didn't work.

This is the code on the item page

<select class="item_size">
    <option value="S"> S </option>
    <option value="M"> M </option>
    <option value="L"> L </option>
    <option value="XL"> XL </option>
    <option value="XXL"> XXL </option>
  </select>
  &nbsp;
<select class="item_color">
    <option value="Blk/Wht"> Black/White </option>
    <option value="Nvy/Pfc"> Navy/Pacific </option>
  </select>
  &nbsp;
<input value="1" class="item_Quantity" type="text" size="3">
<input type="hidden" class="item_id" value="M1001"> </form>
 &nbsp;
 <span class="item_price">$78.00</span>

 and this is part of the code in my javascript

 

this.paypalCheckout = function() {
		
		var winpar = "scrollbars,location,resizable,status",
			strn  = "https://www.paypal.com/cgi-bin/webscr?cmd=_cart" +
		   			"&upload=1" +
		        	"&business=" + this.email + 
					"&currency_code=" + this.currency,
			counter = 1,
			itemsString = "";
			
		
		if( this.taxRate ){
			strn = strn + 
				"&tax_cart=" +  this.currencyStringForPaypalCheckout( this.taxCost );
		}
		
		for( var current in this.items ){
			var item = this.items[current];
			
			var optionsString = "";
			for( var field in item ){
				if( typeof(item[field]) != "function" && field != "id" && field != "price" && field != "quantity" && field != "name" /*&& field != "shipping"*/) {
					optionsString = optionsString + "&" + field + "=" + item[field] ; 
				}
			}
			optionsString = optionsString.substring(1);
			
			itemsString = itemsString 	+ "&item_name_" 	+ counter + "=" + item.name  +
									 	  "&item_number_" 	+ counter + "=" + counter +
										  "&quantity_"		+ counter + "=" + item.quantity +
										  "&amount_"		+ counter + "=" + this.currencyStringForPaypalCheckout( item.price ) + 
										  "&on0_" 			+ counter + "=" + "Options" + 
										  "&os0_"			+ counter + "=" + optionsString;
			counter++;
		}
		
		if( this.shipping() != 0){
			 itemsString = itemsString 	+ "&item_name_" 	+ counter + "=Shipping"  +
									 	  "&item_number_" 	+ counter + "=" + counter +
										  "&quantity_"		+ counter + "=1" + 
										  "&amount_"		+ counter + "=" + this.currencyStringForPaypalCheckout( this.shippingCost );
		}
		
		
		strn = strn + itemsString ;
		window.open (strn, "paypal", winpar);
	};

 

 

Please advise.

 

 

 

 

Login to Me Too
1 REPLY 1

skier
Advisor
Advisor

Here's one example having multiple options and you can find a few tips and more examples here.   Note how the option variables are used.

 

Regards,

 

skier

Login to Me Too

Haven't Found your Answer?

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