Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hey there!
Here's my scenario, I have a sweatshirt that I want to auto-add to cart as a gift if they spend over $75 but since it is a sweatshirt I would need them to select the size. I have done something like this in the past but not with a variant selection variable. Anyone have any experience with this?
Thanks,
Sean
Please refer to the below URL to get the product api usage
https://shopify.dev/docs/api/ajax/reference/product
Get your desired product data using Ajax
Then you will have the list of available variant.
Create custom HTML block to show the variants list to user.
When user select the option you will have variant I'd needed to add item in cart.
Hope this will help...