Issue with add to cart adding 2 products to the cart instead of one

  • Posts: 153
  • Thank you received: 7
  • Hikashop Business
1 month 6 days ago #363921

-- url of the page with the problem -- : www.mainee-learning.com/
-- HikaShop version -- : 5.1.1
-- Joomla version -- : 5.2.0
-- PHP version -- : 8.1.29

I have an issue with one website were you press the add to cart button and 2 products are added to the cart instead of 1, but this only happens on certain browsers.

Google Chrome, Microsoft Edge, and Opera have this issue. However, Safari, Firefox, Brave, and Vivaldi all don't have the problem at all. My client reported the problem to me, and she heard about it from a customer. She didn't test in all the browsers I did, and thought it was a global issue. It turns out it is not.

My client can replicate the problem, as can I. So this is not a one off fluke of an issue.

Has anyone ever seen an issue like this before?

Please Log in or Create an account to join the conversation.

  • Posts: 82823
  • Thank you received: 13370
  • MODERATOR
1 month 6 days ago #363923

Hi,

I tried with Chrome and I couldn't reproduce the issue on your website.
However, I was able to reproduce it with Edge.

I found two things:
- It only happens the first time you click on the add to cart button. Further clicks on it don't produce the issue, unless you refresh the page
- while looking at the network tab of the browser, the issue only happens when an extra "prefetch" is done:
i.imgur.com/2wjR5JX.png
When it works fine, this prefetch doesn't happen.
However, I don't understand why the browser would run this prefetch.
From what I understand, a prefetch can happen when there is a prefetch attribute to the tag:
developer.mozilla.org/en-US/docs/Web/HTM...ributes/rel/prefetch
This is not the case here.

Since no one else reported the issue, it might be something specific to your website. First thing would be to temporarily switch to the default Joomla template and see if you still have the issue with it.
If yes, then it might be some javascript from the template messing with these.
Another thing you can try is to switch the "Action button" setting of the HikaShop configuration. Using a button HTML element instead of a normal link might help circumvent the problem.

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum