You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.
I need to tap into the _onSelectChange method in the Variants class.
If I add my function call directly inside that method it works fine. But I would love to be able to call it directly from product.js but unfortunately I'm just not knowing how to go about it.
I've gotten as far as var variants = new Variants(options); but that options part is confusing. Something about a container and different selectors and product, etc. The lack of documentation makes it very hard to figure out.
Thanks
The text was updated successfully, but these errors were encountered:
adrianocr
changed the title
Any documentation on how to tap into the variants class imported into product.js?
Any documentation on how to tap into the Variants class imported into product.js?
Dec 2, 2018
theme-variants will emit different event that you can listen too in your scripts. In your case, you can look at how we're listening to variantChange in Starter theme.
theme-variants definitely needs some love on the documentation side.
Related documentation issue : Shopify/theme-scripts#44.
I need to tap into the _onSelectChange method in the Variants class.
If I add my function call directly inside that method it works fine. But I would love to be able to call it directly from product.js but unfortunately I'm just not knowing how to go about it.
I've gotten as far as
var variants = new Variants(options);
but thatoptions
part is confusing. Something about a container and different selectors and product, etc. The lack of documentation makes it very hard to figure out.Thanks
The text was updated successfully, but these errors were encountered: