X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   java script help (https://forum.x-cart.com/showthread.php?t=32926)

Dawn Howard 07-31-2007 09:57 AM

java script help
 
I want to add some java scripts to my store front page. I have code to put in the <head> section, the <body> tag and the body section. How do I do this with xcart?

balinor 07-31-2007 10:01 AM

Re: java script help
 
Open up customer/home.tpl and add them in. Note that you will need to use {literal} tags:

{literal}
javascript code
{/literal}

Dawn Howard 07-31-2007 10:15 AM

Re: java script help
 
Thanks

I don't see customer/home.tpl but I have customer/home.php - same thing?

balinor 07-31-2007 10:19 AM

Re: java script help
 
Nope, whenever we are talking about templates, we mean the skin1 directory. So in this case it would be skin1/customer/home.tpl.

Dawn Howard 07-31-2007 10:20 AM

Re: java script help
 
oops I found it skin1/customer/home.tpl

Thanks for your help balinor, you always come through!

balinor 07-31-2007 10:33 AM

Re: java script help
 
I try ;)

Dawn Howard 08-07-2007 10:00 AM

Re: java script help
 
because the script I'm using only effects the front page, I'm getting an error on all my other pages because the <head> section has code referring to code in the <body> section that's not there.

balinor 08-07-2007 10:08 AM

Re: java script help
 
Surround the JS with this and it will only show for the home page:

{if $main eq "catalog" and $current_category.category eq ""}

Javascript here

{/if}


All times are GMT -8. The time now is 02:21 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.