Why is the variant price not updating in main-product.liquid file?

hammaddilawar
New Member
4 0 0

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

Replies 8 (8)

Jivan_Suhagiya
Shopify Partner
582 79 124

Hi @hammaddilawar 

Actually it will not update automatically. You need to update via javascript when variant change. 

If helpful then please Like and Accept Solution.
Email: suhagiyajivan1992@gmail.com
Skype: jivan.suhagiya
First kind of Checkout Reminder APP: https://apps.shopify.com/checkout-reminder
hammaddilawar
New Member
4 0 0

Do you know any example snippet or code for this?

 

Thanks for your reply

Jivan_Suhagiya
Shopify Partner
582 79 124

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.

If helpful then please Like and Accept Solution.
Email: suhagiyajivan1992@gmail.com
Skype: jivan.suhagiya
First kind of Checkout Reminder APP: https://apps.shopify.com/checkout-reminder
hammaddilawar
New Member
4 0 0

Okay sure, Thank you so much. I will let you know

hammaddilawar
New Member
4 0 0

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.

Jivan_Suhagiya
Shopify Partner
582 79 124

Hi,
can you please share store url so I can check?

If helpful then please Like and Accept Solution.
Email: suhagiyajivan1992@gmail.com
Skype: jivan.suhagiya
First kind of Checkout Reminder APP: https://apps.shopify.com/checkout-reminder
fawwadmirza
New Member
5 0 0

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.

riodeloja
Tourist
4 0 1

Dear, could you please share the solution you found?

I am using debutify theme and I am facing the same issue.