Don't show the cart automatically when an item is added

By default, the cart will show automatically when an item is added. However, this behavior can be changed.

When installing Snipcart, you must add a <div id="snipcart"> with your API key:

<div id="snipcart" data-api-key="API_KEY" hidden></div>

You can add the data-config-add-product-behavior attribute to change the behavior, to make sure the cart doesn’t show automatically, use this:

<div id="snipcart"
  data-api-key="API_KEY" 
  data-config-add-product-behavior="none" 
  hidden></div>

Documentation can be found here.

This can also be done in v1 and v2, please refer to this part of our documentation.