0

I'm having a problem with the snipcart shopping cart. I'm using the Grav CMS. Everything works fine until you go a page back with the browser back button. If you've added anything to your cart and after that you go some pages back, the cart doesn't show anything until you reload the page.

This is how I add to the cart, which works perfectly fine for me

<button class="snipcart-add-item" id="add-product" data-item-id="{{ page.header.product.id }}" data-item-price={{ page.header.product.prijs }} data-item-url="{{ page.header.product.url }}" data-item-description="{{ page.header.product.omschrijving }}" data-item-image="{{ page.media.images|first.url }}" data-item-name="{{ page.header.product.naam }}" data-item-quantity="1">
                        Add to cart
                    </button>

Likewise, when you add something to your cart, delete it and go back with the back button, a couple times, the item is added to your cart again until you refresh the page. Anyone got an idea how to fix this?

Thanks for helping!

  • That's not something that should happen with Snipcart itself. You should contact the support at geeks@snipcart.com – Jean-Sébastien Tremblay Jul 20 '20 at 20:43
  • I've also been dealing with a similar behaviour with an integration with Nuxt 2.13. Basically, the snipcart-checkout component remained in "an uninitialized" state randomly: without counter products and total cart price. However, the component did its job well and, once clicked, data inside it reappeared. Since I entered 0 0,00 inside snipcart-checkout div, the oddity has disappeared. – Wonderman Jul 27 '20 at 20:52

0 Answers0