1

I'm banging my head against the wall with this for a month. Setting data-item-stackable="never" in Snipcart V3 does absolutely nothing for me.

But there's more weird things going on:

  1. On my dashboard, I'm getting this message saying:

It seems you’re not using the latest version of our shopping cart. Would you like to switch to the v3.0 ?

Needless to say, I'm using at my site the latest (at the time of writing this) snipcart.js v3.0.31. What is dashboard detecting as Snipcart v2? I've never used Snipcart v2 on the site in question and I didn't migrate from v2 to v3.

  1. In Snipcart v3 documentation, it says that data-item-stackable attribute is enum type. However, in v3 migration guide, it is stated

The data-item-stackable attribute isn't boolean anymore, but a string that describes the different possible behaviors

So is it a string or is it an enum?

I'd like to know if anyone else had an issue with correct version detecting and/or data-item-stackable doing absolutely nothing? Are those two just different manifestations of the same problem I'm having? Has anyone succeeded in getting items "non-stacked" with Snipcart v3, without using Javascript SDK, as intended?

Thank you for your time and effort.

Cheers.

1 Answers1

1

Just got the answer from nice guys at Snipcart. It seems that the problem is that data-item-stackable="never" is not working if data-item-quantity has been set on the snipcart button. Here's their answer:

Even if a product isn't stackable, if you specify the quantity on the product, this value will be used as "default" value, this is why when you click on the buy button it uses the value you set as quantity.

For your use case, I'd recommend adding the items programmatically, please take a look at our JavaScript SDK documentation

They even provided a small example here: https://codesandbox.io/s/crimson-tree-7tffo?file=/index.html