This topic has 13 replies, 5 voices, and was last updated 9 years, 7 months ago ago by Stan Russell
Hi,
My client just found that when adding a product to the cart, then navigating away from that page, e.g. opening the cart and then hitting “back” (using the back button of the browser) the same product is added to the cart again.
Some visitors on the site have encountered this and notified the owner.
Please help to remove this issue.
Thanks & regards,
– Frank
Hello,
Please provide us with link to the page and wp-admin access (full permissions) in Private Content.
Regards,
Robert Hall.
Hello Robert,
Please have a look at our test site, which runs on a bit lower version, but shows the same behaviour.
Thanks & regards,
– Frank
Hello,
I’ve checked your site and when navigating from the Cart page the same product isn’t added to the cart. There are only 1 product in the cart that was added.
Could you please clarify with more details?
Thank you.
Regards,
Eva Kemp.
Hi Eva,
Thanks for looking into this.
I created this screen recording to show you what happens. Please note that the Back button of the browser is used in the process.
Video link: https://www.youtube.com/watch?v=8vhSoqixWQk
Regards,
– Frank
Hello,
We recommend you to update the theme and Woocommerce plugin to latest versions.
Create a back up of your files and database before update!
Also update all required plugins which you can download here https://www.8theme.com/download-plugins/ .
Thank you.
Regards,
Eva Kemp.
Hi Eva,
I can assure you, this is not the reason for the issue to occur. It happens on our live site too, of which you can see the version numbers in the first post of this thread.
Regards,
– Frank
Hi Eva, any news on this one?
I see that the URL contains the command to add the product to the cart. Therefore when it is called again, the product is added again.
On your theme demo however, it seems that the product is added to the cart from a modal box. I do not see the same command in the address bar. So perhaps we are using a different setting or perhaps your new theme version has the solution?
Please share an update.
Thanks & regards,
– Frank
Hello
I have commented few lines of code which were causing syntax error in child theme(please watch private content)
I have also enabled Ajax add to cart(pop up) in theme options->single product page->ajax add to cart and woocommerce->settings->product->ajax add to cart. Now you may check the issue again.
With best regards
Brian Johnson
Hi Brian,
Thanks for looking into our case. It seems that your private content is hidden for me. I cannot seem to open it, even though I am logged in. Are you able to email it to me (see private content for my email address?
Thanks & regards,
– Frank
I have sent an email. You may also view your child theme fuctions.php. This line is already marked with “/” character. Is your issue solved now?
With best regards
Brian Johnson
Yes, thanks very much Brian, the issue is now resolved.
Regards,
– Frank
Hello f1websites,
you are welcome!
Regards,
Stan Russell.
Tagged: add to cart, back button, json array, navigation, persuasive, themes, wordpress woocommerce
The issue related to '‘Add to cart executed again when navigating 'back'’' has been successfully resolved, and the topic is now closed for further responses