Price variant not updating price for product page only

New Member
1 0 0

Hello,

 

so the price stays the same (as the first, lowest one) when I try to change the variants... Only for product page, it updates at check out correctly...

 

I tried another them and it works and updated the price, so its an error in my theme..

 

Product-price.liquid looks like this:

 

<!-- snippet/product-price.liquid -->
{% if product.title %}
  {%- assign compare_at_price = product.compare_at_price -%}
  {%- assign price = product.price -%}
  {%- assign price_varies = product.price_varies -%}
  {%- assign available = product.available -%}
{% else %}
  {%- assign compare_at_price = 1999 -%}
  {%- assign price = 1999 -%}
  {%- assign price_varies = false -%}
  {%- assign available = true -%}
{% endif %}
 
{%- assign money_price = price | money -%}
 
{% if compare_at_price > price %}
  {% if price_varies %}
    <span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span>
<span class="price-new">{{ money_price }}</span>
    <span class="price-old">{{ compare_at_price | money }} </span>
  {% else %}
    <span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span>
<span class="price-new">{{ money_price }}</span>
    <span class="price-old">{{ compare_at_price | money }} </span>
  {% endif %}
{% else %}
 
  {% if price_varies %}
    <span class="price-new">{{ money_price }}</span>
  {% else %}
    <span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span>
    <span class="price-new">{{ money_price }}</span>
  {% endif %}
{% endif %}

 

Any help?

0 Likes
Explorer
65 5 6

Hello 

 

-Want to customize or make changes to a theme? Hire me.
-If my reply was helpful, Click Like to let me know!
- If your question was answered, Mark it as an Accepted Solution!
0 Likes
Highlighted
Excursionist
20 0 5
Hello seadd,

the mechanism for updatding the price on variant change is usually done with Javascript. So I would start to check the console for any JS errors. If you are using chrome browser you can simply right click -> inspect -> console.

Hope that helps :-)
Was this answer helpful?
Leave a thumbs up, so others might find it faster.

Would you like to learn more about Shopify Development?
You might like my Youtube Channel
0 Likes