Need to change variant price value divide_by:10

RajniBobel
Tourist
5 0 1

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: 

 

<div class="price">

{% assign price = product.selected_or_first_available_variant.price %}
{% assign value = "10" %}
<p class="alert alert-success" role="alert">Final Cost :{{ price | divided_by: value | money }}/-</p>
 			
</div>

 

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

Replies 2 (2)
Zworthkey
Shopify Partner
5581 640 1498

@RajniBobel 

{{ product.price | divided_by: 10 }}

 

try out this type.

If helpful, please Like and Accept Solution. Hire Us |
if you Want to modify or Customize your theme | Whatsapp | Email us: sales@zworthkey.com
Top Rated Shopify Agency, | We have Over 200+ Happy merchants.
Build Successful Shopify Stores with GemPages
RajniBobel
Tourist
5 0 1

Hello,

Thanks for your reply.

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