Need to change variant price value divide_by:10

Hello Team,

I need help related to the “selected variant price” divide_by: 10

Example:

My Product Variant Price: Rs 1500

Need to Change Price: Rs 1500/10 = Rs 150

I have already achieved almost, but the problem is The value will change after refreshing the page.

Code:


{% assign price = product.selected_or_first_available_variant.price %}
{% assign value = "10" %}

Final Cost :{{ price | divided_by: value | money }}/-

 			

So, I want this value to change with the selected variant price value without page refresh. Kindly help how I will do it. It is possible or not, and can I use JavaScript for the real-time view.

Thanks,

Rajni Bobel

@RajniBobel

{{ product.price | divided_by: 10 }}

try out this type.

Hello,

Thanks for your reply.

my code is working, but the problem is the “selected variant price” update after refreshing the product page.