| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Help Please! | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Need to add external java script to individual product pages. This is the script:
<script src="http://www.yakkingheads.com/sample.js"> </script> The script is for a talking pop-up spokesperson. I need it to open up on each product page. I got it to work home the home page on xcart by placing it in the customer/home.tpl head section. But cannot figure it out how to get it to work on individual product pages. Please help. |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Do you need this script on product pages only?
Try Code:
__________________
Regards, Victor Dubiniuk X-Cart Skins Store ![]() - twenty two different skins for 4.1.x and 4.2.x; - 4.3.x compatible versions are available; - refresh you store now! Smart menu X-Cart add-on for 4.1.8 - 4.3.x Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x |
|||||||||
#3
|
|||||||
|
|||||||
![]() Yes that code works, but I need to have a different script open for different products. Any help would be great. Thanks
|
|||||||
#4
|
|||||||||
|
|||||||||
![]() The simplest solution is
Code:
For more flexibility you will need an extra field
__________________
Regards, Victor Dubiniuk X-Cart Skins Store ![]() - twenty two different skins for 4.1.x and 4.2.x; - 4.3.x compatible versions are available; - refresh you store now! Smart menu X-Cart add-on for 4.1.8 - 4.3.x Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x |
|||||||||
#5
|
|||||||
|
|||||||
![]() How would I put the product id in the above script? Also what is the product id? The sku? or the product name? Thanks
|
|||||||
#6
|
|||||||||
|
|||||||||
![]() productid is an numeric internal xcart value. It is used in database as a primary key so it is unique. If you browse to any product you will see URL like this
http://yourstore/product.php?productid=14334 14334 is a productid you can also use SKU: Code:
or even product title: Code:
but in last two cases you can get an invalid URL for your script as either title or SKU may contains characters that are not allowed to use in URI
__________________
Regards, Victor Dubiniuk X-Cart Skins Store ![]() - twenty two different skins for 4.1.x and 4.2.x; - 4.3.x compatible versions are available; - refresh you store now! Smart menu X-Cart add-on for 4.1.8 - 4.3.x Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x |
|||||||||
#7
|
|||||||
|
|||||||
![]() Thanks, but It still opens on every product page? I m having a brain fart today. Can you give me the code for it to work if my product id is: 16199
Thanks for all your help. |
|||||||
#8
|
|||||||||
|
|||||||||
![]() {if $product.productid eq 123456}
insert your product id
__________________
xcart 5.1.2 |
|||||||||
#9
|
|||||||
|
|||||||
![]() This is the code I used:
{if $main eq "product"}<script src="http://www.yakkingheads.com/sample {$product.16199}.js"> </script>{/if} It works, but it opens up on every product page. I need it to only open on the product page that has the product id of 16199 Anymore help would be great. Thanks. |
|||||||
#10
|
|||||||||
|
|||||||||
![]() {if $product.productid eq 16199}<script src="http://www.yakkingheads.com/sample
.js"> </script>{/if}
__________________
xcart 5.1.2 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|