Jump to content

Remove just the text of "add to cart" button


Recommended Posts

Hi. I want to put a custom "add to cart" image that already has the text "add to cart". How can I remove just the text add to cart but keep the button's functionality? Is it something I can do with display:none; in the global.css (havent' found where yet) or is it in the product.tpl or somewhere else? I've worked at this for awhile and would appreciate any ideas.

Thanks!

Share this post


Link to post
Share on other sites

All you have to do is just simply edit \themes\prestashop\product.tpl file.

Find this:

<input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive" />



... then replace with your image code, such as:




If you implement more than one theme, don't forget to edit the same file in that/those another theme(s).

Share this post


Link to post
Share on other sites

Thanks! That put me on the right track, but I had to add input type instead of just the img src.

Here's what works:

<input type="image" height="40" width="150" src="http://mysite-button.gif" border="0" />



The only thing is that the

margin:0 auto;

that's in the global.css for this div doesn't center the image anymore. I tried making my own css reference:

#add_to_cart  input{margin:0 auto;}

but that doesn't help and I can't find the issue using firebug.

Any ideas on how to center the button?

Share this post


Link to post
Share on other sites

first can you give us your site?
the button has two classes: one is "exclusive" and the other is "ajax_add_to_cart_button". You may edit one of this class to add a background image using the css : {background-image: url(../path to your image/image.jpg) repeat none, top left;} and erase the value of the button (the actual text Add to Cart)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More