Passing values to shopping cart

General ShopSite user discussion

Passing values to shopping cart

Postby takumaspin » Wed Dec 16, 2009 3:03 am

I am using the Ordering Options field in the shopping cart to allow the customer to choose a date on when to pick up their order. Depending on the customer's order, the earliest date selectable changes.

This will depend on which item they choose. When I go from the product page to the shopping cart, I would like to be able to pass the item number or SKU# of the item to my script.

Is there any way I can do this? I can't edit the cgi files as they are encrypted.

Thanks!
takumaspin
 
Posts: 29
Joined: Wed Sep 30, 2009 10:05 pm
Location: Bay Area

Postby loren_d_c » Wed Dec 16, 2009 11:40 am

If you have ShopSite Pro, then the SKU(s) of the product(s) in the cart should be available in JavaScript variables via the Shopping Cart JavaScript Variables feature. Values available can be found in the documentation here:

http://www.shopsite.com/help/10.0/en-US/sc/pro/cart.variables.html

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

This may help

Postby kirbyglad » Thu Dec 17, 2009 3:22 pm

You can pass variables using GET process (including it with the URL) with this javascript

function gup( name )
{ name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
{
return "";
}
else
{
return results[1];
}
}
//document.write( window.location.href);
var email_parameter = gup( 'email' );
document.write( email_parameter);
kirbyglad
 
Posts: 10
Joined: Mon Dec 07, 2009 2:21 pm
Location: Orem, Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 103 guests

cron