Post by superkershaw » Tue Mar 27, 2012 3:17 am

Hello
I am trying to build a custom theme and have noticed that for some reason, whenever I click the "Add to Cart" button when viewing a single product, I get the error:
site_url/index.php?route=checkout/cart/update 404 (Not Found)
Oddly enough, adding to cart from a category view works fine. Looking at the template for the category view, I have:

Code: Select all

<a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><?php echo $button_cart; ?></a>
Which does not work as the 'product_id' is not defined.

Compared to the default template, I see this javascript binding:

Code: Select all

url: 'index.php?route=checkout/cart/add',
and my template (based on the blank theme) is:

Code: Select all

url: 'index.php?route=checkout/cart/update',
I've tried copying the entire javascript function over but then nothing happens at all upon clicking (no error, just nothing happens). Does anyone have any information regarding how I can troubleshoot this problem? I'm new to Opencart so I may just need a quick understanding of how routing is working.

Thanks a lot!

Newbie

Posts

Joined
Mon Mar 26, 2012 9:53 pm

Post by HammHetfield » Tue Mar 27, 2012 3:25 am

I've never had this issue before, but a new version of Opencart has been released recently and I'm not sure the blank theme is fully compatible with it yet.

I know someone is currently working on updating it and pulling to my repo on GitHub, I will try to find out what is going on with this add to cart button, keep on eye on the github repo, if it gets updated, it could fix your problem :)

Newbie

Posts

Joined
Sun May 29, 2011 6:30 pm

Post by HammHetfield » Tue Mar 27, 2012 8:32 pm

A fix have been posted for this issue. From the description it doesn't completely fixes it but partially so um... Updating should improve the Add to Cart button, but a perfect fix is still awaited.

Newbie

Posts

Joined
Sun May 29, 2011 6:30 pm

Post by developwebdesign » Mon Jul 30, 2012 8:46 pm

I ran into a brick wall whilst creating a custom theme myself. I had overlooked the class declarations within the ajax call and button click event. The button was trying to grab information from ".product-info" when in fact i had removed the div and replaced with a div of a different name. Once i had renamed these attributes in the ajax call everything worked as normal.

I have brought this up as it is one of those things that is easily forgotten about, especially if you are playing with your markup in the template files.

Web Design & Creative Services from Norwich, England!
www.developwebdesign.co.uk
info@developwebdesign.co.uk



Posts

Joined
Fri Feb 17, 2012 12:21 am
Location - Norwich UK

Post by mansetsoft » Sat Nov 24, 2012 5:36 am

i m having same problem here please check
any body can solve this issue...
i have transfer hosting from one server to another server... everything i have uploaded...
all things working f9...

but only when i m going to add to cart of any item .. then next it shows page not found...
i don;t knw ...
please help me out ...
here is urll please check :-

http://www.qualitygenerics-rx.com/index ... ckout/cart

Newbie

Posts

Joined
Sat Sep 22, 2012 8:42 pm
Who is online

Users browsing this forum: No registered users and 14 guests