| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
How do I add Javascript? | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
How do I add Javascript?
I want to create a menu that corresponds to the rest of my site inside of x-cart on in the header. Where do I put the script code for it to affect the info in head.tpl?
__________________
Brad Thompson Group Imaging X-Cart Gold Version 4.1.8 |
|||||||
#2
|
|||||||
|
|||||||
Re: How do I add Javascript?
You'd need to put JS in the <head> tag which is in customer/home.tpl. You also need to surround most JS with {literal} tags to work:
{literal} javascript here {/literal}
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
|
#3
|
|||||||
|
|||||||
Re: How do I add Javascript?
Awesome, worked great. Thanks!
__________________
Brad Thompson Group Imaging X-Cart Gold Version 4.1.8 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: How do I add Javascript?
Adding the script to customer/home.tpl works for all pages (including https) except the cart pages. I can't find where to add the script so my Comodo corner logo appears throughout the checkout process.
__________________
X-cart Gold v4.1.9 Thanks, PengHead007 |
|||||||||
#5
|
|||||||
|
|||||||
Re: How do I add Javascript?
If you are using Fast lane Checkout they have their own set of templates in the Modules/Fast Lane folder.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#6
|
|||||||
|
|||||||
Re: How do I add Javascript?
I thought I had this working and went to check it in IE and for some reason it doesn't work. Here is the link to my cart: http://remembermedisplay.com/order/home.php
I can't figure out why it would work fine in Firefox but not in IE. Any suggestions?
__________________
Brad Thompson Group Imaging X-Cart Gold Version 4.1.8 |
|||||||
#7
|
|||||||||
|
|||||||||
Re: How do I add Javascript?
I need to add 2 javascript files, but not sure where to place them, where x-cart calls them, ect...
I'm using a dynamic drive scrolling marquee for the homepage only, so I'm placing the actual marquee code on that template, but what directory should I copy the two files?
__________________
X Cart Ver: 4.0.14 MySQL4 4.1.22 phpMyAdmin 2.6.0 Pearl 5.6.0 PHP 5.2.1 Python 2.2.2 Server: Apache/2.0.52 (Red Hat) OS: Linux www.cleanlinesurf.com 1. Customer Rewards Points 2. One Page Checkout (altercart) 3. Free shipping orders over $50 as Real Time Shipping 4. Gift Certificates ----------------------------------------------- Graphic Design | Boomobile Design, LLC www.boomobile.com |
|||||||||
#8
|
|||||||
|
|||||||
Re: How do I add Javascript?
It doesn't matter what directory you copy them to. You can create your own directory for them if you want to keep all your 3rd party scripts in a separate folder. You would just have to make sure that where it lists where your code is located, you set it to the directory that you have saved them in. It should look something like this:
Code:
__________________
Brad Thompson Group Imaging X-Cart Gold Version 4.1.8 |
|||||||
#9
|
|||||||||
|
|||||||||
Re: How do I add Javascript?
GI: I have other JS all in one file (it's big), so I'd like to keep this one separate. So where does the code to direct go? what file? and if I have several different JS file, will I need to adjust that, or just place them all in the same directory?
__________________
X Cart Ver: 4.0.14 MySQL4 4.1.22 phpMyAdmin 2.6.0 Pearl 5.6.0 PHP 5.2.1 Python 2.2.2 Server: Apache/2.0.52 (Red Hat) OS: Linux www.cleanlinesurf.com 1. Customer Rewards Points 2. One Page Checkout (altercart) 3. Free shipping orders over $50 as Real Time Shipping 4. Gift Certificates ----------------------------------------------- Graphic Design | Boomobile Design, LLC www.boomobile.com |
|||||||||
#10
|
|||||||
|
|||||||
Re: How do I add Javascript?
Think of it as similar to a CSS reference when you have an external style sheet. You put it in the <head> tags (usually I keep mine near the top to find it quickly). So if it's going into your cart you would be looking for the file skin1/customer/home.tpl. As far as I know there isn't a way to designate it only to the first page in x-cart so if you include it in there it will be loaded with every page of x-cart which shouldn't really matter because the function call is what actually references the file.
__________________
Brad Thompson Group Imaging X-Cart Gold Version 4.1.8 |
|||||||
|
|||
X-Cart forums © 2001-2020
|