Our problem is that the 'on sale' price is showing the same as the normal price. The normal price is incorrect, the sale price is correct.
A while back, I edited my code following the advice of an official shopify help post (https://www.shopify.co.uk/partners/blog/collection-page-price-range) to get a price range to show on collection pages.
Could this be why it is showing incorrectly?
I've double checked the compare at price and price in the product pages and they are definitely correct.
The product in question is the 'clearance - reusable face masks' found here.
Any help would be greatly appreciated as we would like to add a 'sale' section but don't want to until it's correctly showing!
Thanks in advance.
Thanks for the quick reply Sam. I think this is the code I edited following the above tutorial. I had to change it slightly to make it work for our 'refill' products.
{% if variant.title %}
{%- assign compare_at_price = variant.compare_at_price -%}
{%- assign price = variant.price -%}
{%- assign available = variant.available -%}
{% else %}
{%- assign compare_at_price = 1999 -%}
{%- assign price = 1999 -%}
{%- assign available = true -%}
{% endif %}
{%- assign money_price = price | money -%}
<dl class="price{% if available and compare_at_price > price %} price--on-sale{% endif %}{% if available and variant.unit_price_measurement %} price--unit-available{% endif %}" data-price>
{% if section.settings.show_vendor %}
<div class="price__vendor">
<dt>
<span class="visually-hidden">{{ 'products.product.vendor' | t }}</span>
</dt>
<dd>
{{ product.vendor }}
</dd>
</div>
{% endif %}
<div class="price__regular">
<dt>
<span class="visually-hidden visually-hidden--inline">{{ 'products.product.regular_price' | t }}</span>
</dt>
<dd>
{% if available %}
{% if product.price_varies and template == 'collection' %}
From {{ product.price_min | money }} to {{ product.price_max | money }}
Is this what you mean?
<div class="price__sale">
<dt>
<span class="visually-hidden visually-hidden--inline">{{ 'products.product.sale_price' | t }}</span>
</dt>
<dd>
<span class="price-item price-item--sale" data-sale-price>
{{ money_price }}
</span>
<span class="price-item__label" aria-hidden="true">{{ 'products.product.on_sale' | t }}</span>
</dd>
</div>
can you try this for me
{% if available %}
{% if product.price_varies and template == 'collection' %}
From {{ product.price_min | money }} to {{ product.price_max | money }}
{% elsif compare_at_price > price %}
{{ compare_at_price | money }}
{% else %}
{{ money_price }}
{% endif %}
{% else %}
{{ 'products.product.sold_out' | t }}
{% endif %}
Sorry about the slow reply.
Just tried this and while it does change it to the correct pricing, it hasn't got a strikethrough and it also changes the 'refill products' pricing - they used to change depending on variant and with that code they don't.
Does that make sense?
Thanks again for your help.
User | Count |
---|---|
27 | |
18 | |
15 | |
12 | |
10 |