Liquid, JavaScript, themes, sales channels
Join us March 21 for an AMA on planning your 2023 marketing budget with 2H Media co-owners, Matt and Aron
Hi, I write code in main-product.liquide file to show a message about 4 installments.
{{ current_variant.price | plus: 0 | divided_by: 4 | money }}
but the issue is when I click on another size or variant the price is not updating it is just showing the first variant price.
For more information please check the attached video
Actually it will not update automatically. You need to update via javascript when variant change.
Do you know any example snippet or code for this?
Thanks for your reply
Yes, actually there may be available examples but those are depends on which theme you're using. As every themes are different in structure.
If you need any help with code, I can do custom code.
Hi, I tried but not able to write the script can you help me with this please?
{{ current_variant.price | plus: 0 | divided_by: 4 | money }}
so in this current_variant.price price should update when I click on other variants.
Hi,
can you please share store url so I can check?
Hello, Thank You so much,
I tried jQuery on change function now it's working fine. When I click on any variant, it is reloading the price div.
User | RANK |
---|---|
21 | |
20 | |
13 | |
12 | |
8 |
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023One of the key components to running a successful online business is having clear and co...
By Ollie Mar 6, 2023