Jump to content
marketyellow3

[SOLVED] Add to cart button not working

Recommended Posts

Posted (edited)

Hello,

I am currently working on my new Prestashop site with the latest version 1.7.6.1 but now i discovered that the add to cart button doesn't work on the product page it self or the quick view page. In the debug modus it doesn't give a error, is there someone else who also encountered this problem?

Thank you for replying and have a great weekend!

Kind regards,

Peter

Edited by marketyellow3 (see edit history)

Share this post


Link to post
Share on other sites

Check the console tab of the browser's inspect tools and see what javascript errors are there.

Share this post


Link to post
Share on other sites
Posted (edited)

Goodmorning,

This is the SyntaxError i get in the console:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data bottom-88588d81.js:411:108
    paginateComments http://autoonderdelenexpres.nl/themes/laber_complex_home5/assets/cache/bottom-88588d81.js:411
    u http://autoonderdelenexpres.nl/themes/laber_complex_home5/assets/cache/bottom-88588d81.js:39
    fireWith http://autoonderdelenexpres.nl/themes/laber_complex_home5/assets/cache/bottom-88588d81.js:39
    S http://autoonderdelenexpres.nl/themes/laber_complex_home5/assets/cache/bottom-88588d81.js:39
    t http://autoonderdelenexpres.nl/themes/laber_complex_home5/assets/cache/bottom-88588d81.js:39

 

Edited by marketyellow3 (see edit history)

Share this post


Link to post
Share on other sites

It clearly has a problem with JSON data sent by a module probably.

Disable the JS caching in backoffice so there may be a more explanatory JS file name.

Anyway, you'll have to dig into that JS file at that specific line and debug to find out which module has this issue.

Share this post


Link to post
Share on other sites

It was the product comment module from Prestashop so i disabled this module because i don't really need it, the error is now gone but the button still doesn't work. Already cleared the cache in the backoffice and the cache on my own pc. I also tried to disable ajax-shopping cart but still no result. Is it maybe smarter to reinstall Prestashop or do you think it is fixable?

Thank you for the help!

Share this post


Link to post
Share on other sites

I suppose you tested with several browsers and you don't have Cloudflare or similar to cache things.

So, no JS errors in console and no frontend errors with debug activated?

Share this post


Link to post
Share on other sites

Yes i tried on Chrome, Firefox and Microsoft edge also on my mobile phone to be sure.. and i don't have Cloudfare or similar cache things.

And also no JS erorrs in the console with even debug modus on. Could it be a theme issue? i am not using the default one of Prestashop

Share this post


Link to post
Share on other sites
3 minutes ago, marketyellow3 said:

Yes i tried on Chrome, Firefox and Microsoft edge also on my mobile phone to be sure.. and i don't have Cloudfare or similar cache things.

And also no JS erorrs in the console with even debug modus on. Could it be a theme issue? i am not using the default one of Prestashop

I tried to switch to the default theme and the button works there so i have to figure out now how to fix the add to cart button on the theme i am using.

Share this post


Link to post
Share on other sites

Well... For us the issue was this:


We had a chat-function on our page. It seems that the js on the chat-function was overriding the “add to cart”-button.


The “add to cart”-button was functioning on our front page. Then the chat was set in motion, and that seems to have deactivated the js on the “add to cart”-button further “down” on our page.


The solution for us was to remove the chat-function from the store…


Ideally, I would like to have the chat there as well, but now we have the chat on our main page and a functioning web store as well.

 

So I guess the quick answer is to check if there are different plugins or modules that do not work well together…

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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