All things Shopify and commerce
One of my products requires complex variant checks. For example, when option1 value3 is chosen, it cannot allow option 2 value4 or option3 value5, etc, and there are many of these rules I need to implement. Since this is client side, I would imagine I need to do it with javascript rather than liquid.
My issue is, I need to run my check when the user "adds to cart" or "buys it now". My questions are:
1. How would I trigger a javascript call back from those actions (add to cart or buy it now)?
2a. I would not want to disallow the order, just "flag" it (any way is fine, e.g. a note in the order)... is there a way for me to on top of the variant, add a text to this order?
2b. Alternative to product variant, I can just create my own options on the page itself using javascript, but again, is there a way for me to propagate the selection to the order object? (e.g. add information to the POST body of "add" and somehow handle it?)
Thanks, any suggestions/pointers will be appreciated
User | RANK |
---|---|
20 | |
19 | |
17 | |
14 | |
12 |
Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023Summary of EventsBeginning in January of 2023, some merchants reported seeing a large amo...
By Trevor May 15, 2023