Page 1 of 1

Add to cart button not working after transferring domain

Posted: Sun May 20, 2012 6:58 pm
by alexsmith2709
Hi,
I recently changed to a new host. I setup open cart on a temporary domain (IP address) and got everything working as it should, with all my extensions and custom theme.
I have now transferred my domain to my new host and now the "Add to Cart" button wont work on the product page.
I am running version 1.5.2.2.r990. I have run the upgrade script after installing the latest patch.
I dont understand how it can stop working after i now have a domain again. I have changed the config file to the new URL.
I have it with www. without www. i have no style on the page, with no buttons etc so nothing works.

I believe i had this problem before after upgrading to 1.5.2.1 on the old host but cant remember how i fixed it.

Any help is much appreciated.

Thanks,
Alex

Re: Add to cart button not working after transferring domain

Posted: Sun May 20, 2012 7:46 pm
by JAY6390
This would occur if
1. there is a javascript issue (like a file referenced incorrectly causing jQuery not to load say). If you have firebug, that will tell you the issue
2. You're viewing your site on a non-www domain but your site is configured to use www (or vice versa)

Other than that, I can't think why it would not work

Re: Add to cart button not working after transferring domain

Posted: Sun May 20, 2012 9:13 pm
by alexsmith2709
I dont know how to use firebug to find out.
What files do i need to look in to see the jquery references? Is it the header.tpl in the theme?
in my header i still have references to fancybox as im still using that to display the larger images when clicked on the product page. That is the only difference, other than the stylesheet locations.

I have a www. domain and my config file using www.

If someone would like to see my site i'll post the URL.

thanks

Re: Add to cart button not working after transferring domain

Posted: Sun May 20, 2012 9:20 pm
by JAY6390
sure post the url

Re: Add to cart button not working after transferring domain

Posted: Sun May 20, 2012 9:23 pm
by alexsmith2709

Code: Select all

www.purpleandblackalternative.co.uk/shop/[code]

Re: Add to cart button not working after transferring domain

Posted: Sun May 20, 2012 9:32 pm
by JAY6390
By the looks of it you've updated/your theme is not the right version, and your url is posting to

Code: Select all

"NetworkError: 404 Not Found - http://www.purpleandblackalternative.co.uk/shop/index.php?route=checkout/cart/update"
where as your working category pages add to cart using the URL

Code: Select all

http://www.purpleandblackalternative.co.uk/shop/index.php?route=checkout/cart/add
So you need to sort the code in your product.tpl file to point to
checkout/cart/add
instead of
checkout/cart/update

Re: Add to cart button not working after transferring domain

Posted: Sun May 20, 2012 9:42 pm
by alexsmith2709
Thank you very much JAY6390.
Its now working. I had a feeling it would be something simple like that.

Re: Add to cart button not working after transferring domain

Posted: Sun May 20, 2012 9:48 pm
by JAY6390
Cool no problem :)

Re: Add to cart button not working after transferring domain

Posted: Mon May 28, 2012 11:20 am
by ncodage
Hello,

I'm having the same problem and believe it might be the same kind of issue.
I installed Firebug and tried to troubleshoot without success.
Any help would be appreciated.

Martin

Re: Add to cart button not working after transferring domain

Posted: Mon May 28, 2012 7:00 pm
by JAY6390
Hi Martin

Did you check the first two debugging questions I gave? Are you for example viewing your site on a non-www version yet your sites configured to have www ? (or vice versa)

Re: Add to cart button not working after transferring domain

Posted: Fri Jul 13, 2012 5:18 pm
by khantisari
i have same issue

i have try to view on a non-www version and www version. it is same..

i have solved it....

for people who have same problem just edit url: 'index.php?route=checkout/cart/update', to url: 'index.php?route=checkout/cart/add', in catalog/view/theme/template/product

Re: Add to cart button not working after transferring domain

Posted: Fri Jul 13, 2012 7:08 pm
by JAY6390
That will be a theme issue, as your theme won't be current for the opencart version

Re: Add to cart button not working after transferring domain

Posted: Mon Mar 02, 2015 1:44 am
by Jinal
Hi Jay,

I need your help add to cart option is not working in my website http://sabydiamonds.com please check and revert back to me asap.

Rest all is working fine. If you can help i will be really grateful.

Thanx,
Jinal

Add to cart button not working

Posted: Mon Apr 27, 2015 6:18 pm
by mshahzad
Hi
i am using opencart 2.0.2.0 , in starting above mention button is working but this is not working kindly suggest what can i do , already change the htaccess or config file but not working please advice , alrady reinstall , but no working please advice