I have a question about the JS API that I dont found how to solve right now… I have created checkboxes for my variants to add/remove items to cart and I do this by using the JS API. The problem is, I dont use the “snipcart-add-item” class because having this on a checkbox doesnt resolve in the behaviour you would except on a checkbox. Unchecking it would add another item and so on. So my question is, how can I still validate my item-id inside the final step of the checkout? Is this sth that is not possible? Did I messed up trying to create checkboxes for my GUI? Any help would be great
Our HTML crawler needs to find the corresponding
snipcart-add-item element to validate each products in the cart, but it doesn’t need to be visible. Adding a button with
display: hidden; should do the trick!
You could also use the JSON crawler, which enables you to list your products independently from your HTML markup. More info on this here: Order validation – Snipcart Documentation