Javascript in Cart

General ShopSite user discussion
Post Reply
OldSalt
Posts: 23
Joined: Mon Sep 28, 2009 4:37 pm
Location: MA

Javascript in Cart

Post by OldSalt »

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/ ... ntent.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!
BFChris
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Post by BFChris »

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
--------------------------------
loren_d_c
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere
Contact:

Post by loren_d_c »

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
OldSalt
Posts: 23
Joined: Mon Sep 28, 2009 4:37 pm
Location: MA

Post by OldSalt »

Hi Folks,

Thanks for the responses; I really appreciate it!

Turns out the issue was with the script ... works fine now.
Post Reply