Javascript in Cart

General ShopSite user discussion

Javascript in Cart

Postby OldSalt » Wed Sep 30, 2009 9:29 am

Hello,

I am trying to insert some javascript into a shopsite 10 cart template, but the javascript is not being parsed.

After reading
http://shopsite.com/help/10.0/en-US/sc/pro/index.htm?page=/help/10.0/en-US/sc/pro/working/faq.pages.content.html
I put the javascript in the header, enclosed by <META name="MyContent" content="
....
javascript here
...
">

Viewing source after placing an order simply shows my javascript, complete with vars not their values.

Maybe I need to escape my quotes?

Can anyone provide a clue??

Thanks!
OldSalt
 
Posts: 23
Joined: Mon Sep 28, 2009 4:37 pm
Location: MA

Postby BFChris » Wed Sep 30, 2009 9:55 am

Javascript will not work in a meta-tag. You put the javascript code in the FIELD for header information, but it should not be wrapped in a <meta> tag.
Javascript should be wrapped in <script></script> tags.

Also, for use in a CART template, you can use the field "Javascript added at start of built-in CheckIt function" that appears under "Commerce Setup"--Order System--Checkout.
~~Barefoot Chris
--------------------------------
Barefoot Chris Web Design
www.barefootchris.net
--------------------------------
BFChris
 
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Postby loren_d_c » Wed Sep 30, 2009 1:07 pm

If you want your JavaScript to be on the ShopSite thankyou receipt screen that displays when an order is completed, then you should put it in one of the fields in Commerce Setup -> Order System -> Thank You.

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

Postby OldSalt » Wed Sep 30, 2009 2:09 pm

Hi Folks,

Thanks for the responses; I really appreciate it!

Turns out the issue was with the script ... works fine now.
OldSalt
 
Posts: 23
Joined: Mon Sep 28, 2009 4:37 pm
Location: MA


Return to User Forum

Who is online

Users browsing this forum: No registered users and 106 guests