Product Page: Current Variant Price not updating on variant change

Product Page: Current Variant Price not updating on variant change

Thor_SA
Shopify Partner
13 1 3

Hi Everyone.

 

Im hoping someone could assist me with a solution to this problem.

 

Store: https://aboschuh.ch/products/abonnieren

Problem:

We have 2 variant options for this product which are required to display the 2 different pricing structures based on which variant is selected.

Variant 1: Mieten: CHF 12.90 

&

Variant 2: Kaufen: CHF 229.00

 

I am hoping to update the Pricing and display on the page as follows:

 

Mieten: CHF 12.90 /Monat Regulärer PreisCHF 229.00
&
Kaufen: CHF 229.00
 
However I am facing what seems like a common problem on Shopify, my pricing field does not seem to update fully based on the variant selection. I have tried using various solutions but have not been able to fix this.
 
The code I have used is located in the product.blocks.liquid
 
 

 

{%- when 'price' -%}
<div class="product__price fs-body-base">
{% if current_variant.price <= 1290 %}
Mieten:<span data-price> {{ current_variant.price | money_with_currency }}
</span>/Monat
{% endif %}
{% if current_variant.price > 1290 %}
Kaufen:<span data-price> {{ current_variant.price | money }}</span>
{% endif %}

 

 

It renders part of what i am needing but unfortunately a hard refresh is required to change the full extent of the pricing field.

 

Could someone kindly assist me with this and how to implement correctly.

 

Thanks in advance

Thor

 
Reply 1 (1)
Thor_SA
Shopify Partner
13 1 3

Hi Agrace, sounds great. Thank you, looking forward to your help