How do I change which variant price shows up on the collection pages- help!

Tourist
4 0 0

I would like to change which variant price shows up on the collection pages  - I would like all the collections page to show the highest variant price using the Debut theme?

 

Any help appreciated as I am a complete beginner!

 

Thank you so much :)

0 Likes
Shopify Partner
532 110 150

@PaulBarkerMusic 

 

Go to the Online store > Theme > Edit code > Snippets > product-price.liquid file and replace code with following:

<!-- snippet/product-price.liquid -->
{% if product.title %}
  {%- assign compare_at_price = product.compare_at_price_max -%}
  {%- assign price = product.price_max -%}
  {%- 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 available %}
    <span class="visually-hidden visually-hidden--inline">{{ 'products.product.regular_price' | t }}</span>
    <s class="product-price__price">{{ compare_at_price | money }}</s>
    <span class="visually-hidden visually-hidden--inline">{{ 'products.product.sale_price' | t }}</span>
    <span class="product-price__price product-price__sale">
      {{ money_price }}
      <span class="product-price__sale-label" aria-hidden="true">{{ 'products.product.on_sale' | t }}</span>
    </span>
  {% else %}
    <span class="product-price__sold-out">{{ 'products.product.sold_out' | t }}</span>
  {% endif %}

{% else %}

  {% if available %}
    <span class="product-price__price">{{ money_price }}</span>
  {% else %}
    <span class="product-price__sold-out">{{ 'products.product.sold_out' | t }}</span>
  {% endif %}

{% endif %}


Let me know if it not works for you.

 

Cheers,

Tejas

Shopify Expert | skype: tejas.nadpara
- Feel free to contact me on support@hexaecommerce.com regarding any help
- Like and Mark as an Accepted Solution if reply helpful
1 Like
Tourist
4 0 0
Hi Tejas,

Just mean paste it in?
0 Likes
Highlighted
Shopify Partner
532 110 150

@PaulBarkerMusic 

 

Yes, just copy/paste the code.

Shopify Expert | skype: tejas.nadpara
- Feel free to contact me on support@hexaecommerce.com regarding any help
- Like and Mark as an Accepted Solution if reply helpful
1 Like
Tourist
4 0 0

Hi Tejas,

Thank you for the help.

Yes the new code does make the highest priced variant appear in the collections pages but unfortunately, it has added a new problem:

* When the customer goes to the check out and selects the variants they want for the product (often more than one variant when buying) the price of the products variants do not change (it just stays on the highest variant price) so the customer would not know the correct prices they are paying for each variant?

 

I thought we had it but not quite.

 

Paul

0 Likes