Javascript Variables

General ShopSite user discussion

Javascript Variables

Postby sreno@ebeacon.com » Wed Feb 21, 2007 1:45 pm

I'm creating my own layout for the Thank You page by embedding the javascript variables in my template. Everything works fine except for the ss_name. I'm trying to print out the customer name but I keep getting the name of the first item in the cart. Any ideas?

<script>
document.write("<tr><td>Name</td><td>" + ss_name + "</td></tr>");
document.write("<tr><td>Email Address</td><td>" + ss_email + "</td></tr>");
document.write("<tr><td>Address 1</td><td>" + ss_address1 + "</td></tr>");
document.write("<tr><td>Address 2</td><td>" + ss_address2 + "<td></tr>");
document.write("<tr><td>City</td><td>" + ss_city + "</td></tr>");
document.write("<tr><td>State</td><td>" + ss_state + "</td></tr>");
document.write("<tr><td>Zip Code</td><td>" + ss_postalcode + "</td></tr>");
document.write("<tr><td>Country</td><td>" + ss_country + "<td></tr>");
document.write("<tr><td>Phone Number</td><td>" + ss_phone + "</td></tr>");
</script>
sreno@ebeacon.com
 
Posts: 1
Joined: Wed Feb 21, 2007 1:41 pm

Postby loren_d_c » Wed Feb 21, 2007 3:53 pm

Looking at the JavaScript Variables that actually appear in a thankyou.cgi screen source, it appears that the ss_name variable will not work for the name of the shopper currently, because AFTER it is assigned the value of the shopper's name, the same ss_name variable name is then declared as an array and used to store the product names, thereby wiping out the customer name data that was previously in it. So until the developers change this and give the customer name a new/unique variable name, you will not be able to use it in your JavaScript.

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

Seriously??

Postby mltsy » Fri May 04, 2007 9:09 am

I'm surprised they haven't fixed this yet. I just tried to do something similar - what a ridiculous bug.
mltsy
 
Posts: 23
Joined: Fri May 04, 2007 9:06 am

Postby loren_d_c » Fri May 04, 2007 9:41 am

This has already been fixed in ShopSite v8.3, you probably just don't have this latest version of ShopSite. The new variable for the shopper's billing name in v8.3 is ss_billname, see the documentation at:

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

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


Return to User Forum

Who is online

Users browsing this forum: No registered users and 123 guests