Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How do I... use an image for Add to Cart button?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-18-2004, 06:21 PM
  EnriqueHavoc's Avatar 
EnriqueHavoc EnriqueHavoc is offline
 

eXpert
  
Join Date: Jul 2004
Posts: 232
 

Default 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?
Reply With Quote
  #2  
Old 08-20-2004, 01:50 AM
 
netmagik netmagik is offline
 

Advanced Member
  
Join Date: Aug 2004
Posts: 39
 

Default

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.
__________________
--------

The only constant in life is change
Reply With Quote
  #3  
Old 08-20-2004, 02:40 AM
  EnriqueHavoc's Avatar 
EnriqueHavoc EnriqueHavoc is offline
 

eXpert
  
Join Date: Jul 2004
Posts: 232
 

Default

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!
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:16 PM.

   

 
X-Cart forums © 2001-2020