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)
-   -   How do I... use an image for Add to Cart button? (https://forum.x-cart.com/showthread.php?t=8974)

EnriqueHavoc 08-18-2004 06:21 PM

How do I... use an image for Add to Cart button?
 
im using x-cart 4.0.0 and im trying to change the /buttons/add_to_cart.tpl to use a custom image for the "add to cart" link instead of button.tpl.

I can get the image to show up, but the $href variable doesnt work right and in the browser just shows up as "http://website/store/$href" instead of the actual link...

am i going about this right? i tried copying all the javascript $href variable code from button.tpl and put it in add_to_cart.tpl but that doesnt work either...

how do i use the $href variable?

netmagik 08-20-2004 01:50 AM

I did this by simply changing the code in skin1/buttons/add_to_cart.tpl to:

[img]{$ImagesDir}/buttons/add_to_cart.gif[/img]

Make sure your image path is correct and it should work fine providing the original reference to the button template is correct:

{include file="buttons/add_to_cart.tpl"}

Hope it's the same in version 4! My version is 3.4.8 though my sig may say different.

HTH
Mat

PS. This works with all buttons, but will not let you use mutiple languages, obviously.

EnriqueHavoc 08-20-2004 02:40 AM

yes that did the trick!


the code looked a little bit different at first:

/customer/main/product.tpl:
********************************************
{include file="buttons/add_to_cart.tpl" style="button" href="javascript:if (FormValidation()) document.orderform.submit()"}
********************************************

changed to:
********************************************
{include file="buttons/add_to_cart.tpl" style="button"}
********************************************

Thanks very much netmagik! cheers!


All times are GMT -8. The time now is 03:45 AM.

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