How do I show the max product price

natasha3
New Member
13 0 0

Hello, I am trying to change the price, as my products all have 8 variets, and it seems to pick the lowset priced item to represent the products in all  of the collection pages. I am using the Minimal theme. 

Thanks!

Replies 6 (6)
Matthew_Skala1
Shopify Partner
103 0 15

I did something like this in my store by modifying the Minimal theme as follows.  I changed the "From html" translation (under the "Products" tab of "Edit language") to read:

From {{ price_min }} to {{ price_max }}

and I changed the product-grid-item.liquid file, in the "Snippets" folder of the theme's code, to replace the section near the end from <p class="grid-link__meta"> to </p>, to read:

      <p class="grid-link__meta">
        {% capture price %}{{ featured.price | money_without_trailing_zeros }}{% endcapture %}
        {% capture price_min %}{{ featured.price_min | money_without_trailing_zeros }}{% endcapture %}
        {% capture price_max %}{{ featured.price_max | money_without_trailing_zeros }}{% endcapture %}
        {% if on_sale %}
        <span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span>
        <s class="grid-link__sale_price">{{ featured.compare_at_price | money }}</s>
        {% endif %}
        {% if featured.price_varies %}
          {{ 'products.general.from_html' | t: price_min: price_min, price_max: price_max }}
        {% else %}
          {% if on_sale %}
            <span class="visually-hidden">{{ 'products.product.sale_price' | t }}</span>
          {% else %}
            <span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span>
          {% endif %}
          {{ price }}
        {% endif %}
      </p>

Note the difference here is adding a couple of "capture" lines for minimum and maximum price instead of just asking for "price" (which does seem to default to minimum) and then passing the minimum and maximum when it calls the translation.  Note also that I used "money_without_trailing_zeroes" because that's what I wanted; you could instead just say "money" as the original did.

This only changes it in "grid item" snippets, but that's the only place where the "From (price)" language is used in this theme.

There are solutions for other themes floating around but I don't remember finding this one ready-made - I think I had to hack it together myself.  All the usual disclaimers apply.

natasha3
New Member
13 0 0

Thanks for the help Matthew! I am goung to try this right now.

natasha3
New Member
13 0 0

I am not sure what you mean by "From html" translation (under the Products" tab of "Edit language") to read" Are you talking about the product-grid-item.liquid file, in the "Snippets" folder? Is that where i am suppos to edit language? 

Thanks.

Matthew_Skala1
Shopify Partner
103 0 15

When you go to edit a theme, there is an option called "Edit language" - it is a separate thing from editing the code.  This is where you would add translations if you wanted your store to be in a language other than English.  Inside the language editor there's a tab called "Products" and the first item in there is "From html"  I think the default value is "From {{ price }}".

(Just checked):  It should appear under "Actions" for the theme.  Where you would click "Edit code," you can click "Edit language" instead.

natasha3
New Member
13 0 0

It worked! Thanks for helping Matthew! I really appreciate it.

Fernbaby
Tourist
9 0 5

This has helped me too!! Thanks