Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Help! Add to Cart button doesn't Add to Cart

Help! Add to Cart button doesn't Add to Cart

Views: 1,249

Results 1 to 6 of 6
6 Feb 2013, 11:15 PM
#1
wwrepair avatar

wwrepair

New Zenner

Join Date:
Jun 2012
Posts:
92
Plugin Contributions:
0

Help! Add to Cart button doesn't Add to Cart

Please help, My add to cart button doesn't add the products to the cart!!
http://wwrepair.com/parts

6 Feb 2013, 11:27 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Help! Add to Cart button doesn't Add to Cart

Looking at you page source, I think your problem starts here:

<div id="currency_header"> ```html <!-- Currencies -->
					<form name="currencies" action="http://www.wwrepair.com/parts/index.php?main_page=index" method="get">                        
                                            
                <!--       Currency: <select name="currency" class="header1_sel" onchange="this.form.submit();">
<option value="USD" selected="selected">US Dollar</option> </select> <input type="hidden" name="main_page" value="product_info" /><input type="hidden" name="cPath" value="151_192" /><input type="hidden" name="products_id" value="5167" /> </form> <!-- End Currencies -->
                </div>

You have commented out the CLOSING FORM tag, but not the opening one.

Later, you get the shopping cart <form>, but it is in conflict with the already-open currencies form.
6 Feb 2013, 11:35 PM
#3
wwrepair avatar

wwrepair

New Zenner

Join Date:
Jun 2012
Posts:
92
Plugin Contributions:
0

Re: Help! Add to Cart button doesn't Add to Cart

OMG!! I love you!! That fixed it. Wow, that was scary..thank you so much!!

6 Feb 2013, 11:44 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Help! Add to Cart button doesn't Add to Cart

If there is a switch in the admin panel to show/hide elements, then that is what should be used in preference to hard-coding such behaviour.

Only hard-code a functional element if there is no other way to obtain/remove the desired behaviour.

7 Feb 2013, 12:05 AM
#5
wwrepair avatar

wwrepair

New Zenner

Join Date:
Jun 2012
Posts:
92
Plugin Contributions:
0

Re: Help! Add to Cart button doesn't Add to Cart

schoolboy:

If there is a switch in the admin panel to show/hide elements, then that is what should be used in preference to hard-coding such behaviour.

Only hard-code a functional element if there is no other way to obtain/remove the desired behaviour.

I am not aware of anyway to remove the currency header in admin. If there is, please tell me and I will change the code back to the way it was. I also prefer not to change the code unless I have to, you are absolutely correct.

7 Feb 2013, 6:42 AM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Help! Add to Cart button doesn't Add to Cart

WWRepair:

I am not aware of anyway to remove the currency header in admin. If there is, please tell me and I will change the code back to the way it was. I also prefer not to change the code unless I have to, you are absolutely correct.

For your template, there may not be a switch in admin... All I am saying is that when there IS a switch, it's better to use it.

I make a lot of changes to the code and also make mistakes, so what I do is this:

  1. FTP a COPY of the file I want to change to my computer.
  2. Make the changes on that copy.
  3. BEFORE I ftp it back to the server, I re-name the original file to something like tpl_abcde.SUSP (does not really matter what you name it as, so long as it's not "php".
  4. Then I FTP the edited copy to the appropriate location.
  5. If my changes break things, I simply REMOVE my copy, and RE-NAME the SUSP file back to php .