Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Changing add to cart button

Changing add to cart button

Views: 1,062

Results 1 to 7 of 7
15 Nov 2013, 2:26 PM
#1
mdo82 avatar

mdo82

New Zenner

Join Date:
Apr 2010
Posts:
39
Plugin Contributions:
0

Changing add to cart button

a while ago I changed the button "add to cart" on this page (I'm just lost the name of this page). They are both in new products, category and product listing. However, I do not remember how I got this done.

I work with two languages ​​in my shop (Dutch and English) and i'm not been able to get change this button in English.

Anyone have a tip so that i can change the button? :smile:

If i look on the source code the the code i have in dutch:

<form name="multiple_products_cart_quantity" action="http://www.nailpolishfashion.nl/index.php?main_page=index&cPath=2_240&language=nl&sort=20a&action=multiple_products_add_product" method="post" enctype="multipart/form-data"><div id="productListing">
<div class="buttonRow forward"><input type="image" src="includes/templates/simple_zen/buttons/dutch/button_add_selected.gif" alt="Geselecteerde artikelen toevoegen aan wagentje" title=" Geselecteerde artikelen toevoegen aan wagentje " id="submit1" name="submit1" /></div>
<br class="clearBoth" />

In english:

<form name="multiple_products_cart_quantity" action="http://www.nailpolishfashion.nl/index.php?main_page=index&cPath=2_240&sort=20a&action=multiple_products_add_product" method="post" enctype="multipart/form-data"><div id="productListing">
<div class="buttonRow forward"><input class="cssButton button_add_selected" onmouseover="this.className='cssButtonHover button_add_selected button_add_selectedHover'" onmouseout="this.className='cssButton button_add_selected'" type="submit" value="Add Selected Products to Cart" style="width: 188px;" /></div>
<br class="clearBoth" />
15 Nov 2013, 3:03 PM
#2
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Changing add to cart button

mdo82:

a while ago I changed the button "add to cart" on this page (I'm just lost the name of this page). They are both in new products, category and product listing. However, I do not remember how I got this done.

I work with two languages ​​in my shop (Dutch and English) and i'm not been able to get change this button in English.

Anyone have a tip so that i can change the button? :smile:

If i look on the source code the the code i have in dutch:

<form name="multiple_products_cart_quantity" action="http://www.nailpolishfashion.nl/index.php?main_page=index&cPath=2_240&language=nl&sort=20a&action=multiple_products_add_product" method="post" enctype="multipart/form-data"><div id="productListing"> <div class="buttonRow forward"><input type="image" src="includes/templates/simple_zen/buttons/dutch/button_add_selected.gif" alt="Geselecteerde artikelen toevoegen aan wagentje" title=" Geselecteerde artikelen toevoegen aan wagentje " id="submit1" name="submit1" /></div> <br class="clearBoth" /> ``` > > In english: > > ``` <form name="multiple_products_cart_quantity" action="http://www.nailpolishfashion.nl/index.php?main_page=index&cPath=2_240&sort=20a&action=multiple_products_add_product" method="post" enctype="multipart/form-data"><div id="productListing"> <div class="buttonRow forward"><input class="cssButton button_add_selected" onmouseover="this.className='cssButtonHover button_add_selected button_add_selectedHover'" onmouseout="this.className='cssButton button_add_selected'" type="submit" value="Add Selected Products to Cart" style="width: 188px;" /></div> <br class="clearBoth" /> ```

If you want to change the text of the button you can create an override for includes/languages/your_language/override/button_names.php and edit the button text in that file.

Thanks,

Anne

15 Nov 2013, 3:10 PM
#3
mdo82 avatar

mdo82

New Zenner

Join Date:
Apr 2010
Posts:
39
Plugin Contributions:
0

Re: Changing add to cart button

picaflor-azul:

If you want to change the text of the button you can create an override for includes/languages/your_language/override/button_names.php and edit the button text in that file.

Thanks,

Anne

Thanks for your reply.

I have the follow text in my includes/languages/english/override/button_names.php

define('BUTTON_IMAGE_ADD_TO_CART', 'button_add_to_cart.gif');
define('BUTTON_IMAGE_ADD_PRODUCTS_TO_CART','button_add_selected.gif');

I think that i have change the code somewhere, because the source code of the dutch page is

<div class="buttonRow forward"><input type="image" src=" 

in english is this:

<div class="buttonRow forward"><input class="cssButton button_add_selected

I have tried to find this with the developer toolkit, but can not find it

15 Nov 2013, 3:14 PM
#4
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Changing add to cart button

mdo82:

a while ago I changed the button "add to cart" on this page (I'm just lost the name of this page). They are both in new products, category and product listing. However, I do not remember how I got this done.

I work with two languages ​​in my shop (Dutch and English) and i'm not been able to get change this button in English.

Anyone have a tip so that i can change the button? :smile:

If i look on the source code the the code i have in dutch:

<form name="multiple_products_cart_quantity" action="http://www.nailpolishfashion.nl/index.php?main_page=index&cPath=2_240&language=nl&sort=20a&action=multiple_products_add_product" method="post" enctype="multipart/form-data"><div id="productListing"> <div class="buttonRow forward"><input type="image" src="includes/templates/simple_zen/buttons/dutch/button_add_selected.gif" alt="Geselecteerde artikelen toevoegen aan wagentje" title=" Geselecteerde artikelen toevoegen aan wagentje " id="submit1" name="submit1" /></div> <br class="clearBoth" /> ``` > > In english: > > ``` <form name="multiple_products_cart_quantity" action="http://www.nailpolishfashion.nl/index.php?main_page=index&cPath=2_240&sort=20a&action=multiple_products_add_product" method="post" enctype="multipart/form-data"><div id="productListing"> <div class="buttonRow forward"><input class="cssButton button_add_selected" onmouseover="this.className='cssButtonHover button_add_selected button_add_selectedHover'" onmouseout="this.className='cssButton button_add_selected'" [B]type="submit"[/B] value="Add Selected Products to Cart" style="width: 188px;" /></div> <br class="clearBoth" /> ```

It appears that in Dutch the button is a shopping cart icon while in English it is a CSS button.. correct???

First copy the button image includes/templates/simple_zen/buttons/dutch/button_add_selected.gif to includes/templates/simple_zen/buttons/english/

Then to force the graphic button versus the CSS button to show:

lat9:

Since the button is a submit-type button, the default button-processing won't call the CSS button function if the button's alt-text is longer than 30 characters. So you can just change the define (in /includes/languages/english/YOUR_TEMPLATE/button_names.php) to have move than 30 characters and the button image will be loaded instead!

15 Nov 2013, 4:35 PM
#5
mdo82 avatar

mdo82

New Zenner

Join Date:
Apr 2010
Posts:
39
Plugin Contributions:
0

Re: Changing add to cart button

DivaVocals:

It appears that in Dutch the button is a shopping cart icon while in English it is a CSS button.. correct???

First copy the button image includes/templates/simple_zen/buttons/dutch/button_add_selected.gif to includes/templates/simple_zen/buttons/english/

Then to force the graphic button versus the CSS button to show:

That was the solution :clap: is it possible to forced through custom coding the image instead of the CSS buttons by shorter length of the text ?

15 Nov 2013, 4:49 PM
#6
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Changing add to cart button

mdo82:

That was the solution :clap: is it possible to forced through custom coding the image instead of the CSS buttons by shorter length of the text ?

It's software.. anything is possible.. and if you want to PAY someone to make this change for you you could.. the question is WHY when you have a FREE and SIMPLE solution available??

the other option is to NOT use the CSS buttons..

15 Nov 2013, 5:38 PM
#7
mdo82 avatar

mdo82

New Zenner

Join Date:
Apr 2010
Posts:
39
Plugin Contributions:
0

Re: Changing add to cart button

Well I thought of spaces will not work, but so that was not a problem so I had to whether you could change it, but I just buried a number of spaces, so it works.

Thanks :smile: