Hello,
I am trying to create custom code to prevent products which are tagged as ‘secondary’ from being added to the cart without a ‘primary’ tagged product already in the card. This is in Shopify Crave theme.
I had really hoped this simple feature was included in Shopify but alas, another costly plug-in app may be required…
My store url is nativeangusbeef.com.au
Here is the code I am generating from AI:
I am testing by adding a secondary item to an empty card. While an error message appears, the form submission still proceeds and the ‘secondary’ item is still added to the cart, despite there being no primary item.
Thank you for any assistance you can provide.