Collection page displays wrong variant price

Highlighted
Tourist
19 0 1

Hi All,

I recently updated my product pages with the new Shopify variant functionality but on the collection pages, the wrong variant price is being displayed.  On the following page, the item in the 2nd row, furthest to the right "Multi-Tier Cubic Zirconia Earrings" - the price displayed should be $95.00 (not $70.00):

http://giavan.com/collections/earrings

On this item's product page the $95.00 image/price are displayed when the page loads, so I have no idea why the collection page is showing the least expensive variant price.  The collection page is displaying the correct image.

Here is the code for that section of the collection page:

<ul id="four-column-collectionlist"> 

    {% for product in collection.products %}
    <li class="collectionitem four columns" data-alpha="{{product.title}}" data-price="{{product.price}}">     
        <div class="four-column-collection-image">
        {% if product.price < product.compare_at_price %}<div class="sale"></div>{% endif %}
        {% if product.available %}{% else %}<div class="gone"></div>{% endif %}
        
        {% if product.images.size > 1 %}      
          {% unless collection.handle == 'swarovski-crystal-colors' or collection.handle == 'pearl-colors'%}
                  <a href="{{ product.url | within: collection }}" title="{{ product.title | escape }}">
                    {% endunless %}
                    <img class="img1 lazy scale-with-grid" src="{{ product.images[0] | product_img_url: 'large' }}" alt="{{ product.title | escape }}" />
                  <img class="img2 scale-with-grid" src="{{ product.images[1] | product_img_url: 'large' }}" alt="{{ product.title | escape }}" /> 
                  </a>       
        {% else %}   
           {% unless collection.handle == 'swarovski-crystal-colors' or collection.handle == 'pearl-colors'%}
                <a href="{{ product.url | within: collection }}" title="{{ product.title | escape }}">
                  {% endunless %}
                  <img class="img1 lazy scale-with-grid" src="{{ product.images[0] | product_img_url: 'large' }}" alt="{{ product.title | escape }}" />
                  </a>
        {% endif %}       
          
        </div>

        <div class="collection-products">
          <h2>
            {% unless collection.handle == 'swarovski-crystal-colors' or collection.handle == 'pearl-colors'%}<a href="{{ product.url | within: collection }}">{% endunless %}{{ product.title | truncate: 70 }}<br></a>
      
            {% unless collection.handle == 'swarovski-crystal-colors' or collection.handle == 'pearl-colors'%}
            <span class="money">{% if customer.tags contains 'store' %}MSRP: {% endif %}{{ product.price | money }}</span> {% if product.price < product.compare_at_price %} was <span class="red">{{ product.compare_at_price | money }}</span>{% endif %}
            {% if customer.tags contains 'store' %}<br><span>Wholesale: {{ product.metafields.local.wholesale_price | money }}</span>{% endif %}{% endunless %}
          </h2>
          
        </div>
    </li>
  {% endfor %}
  </ul>

Thanks in advance for your help with this!

0 Likes
Highlighted
Shopify Staff
Shopify Staff
5704 1 326

In Shopify, collection pages always show the least expensive variant price.

To show the price of the first variant instead, replace this:

{{ product.price | money }}

... with:

{{ product.variants.first.price | money }}

Because this:

{{ product.price | money }}

... is the same as:

{{ product.price_min | money }}

 

Highlighted
Tourist
19 0 1

Thanks, that did it.

0 Likes
Highlighted
New Member
1 0 0

This will not work for me.  I am lost.

Go on without me....

0 Likes
Highlighted
New Member
1 0 0

The product page displays the correct variant price whichever variant is selected. How do I display the variant's price on the collections page? The price and SKU numbers have to change when different variant is selected. Here is my collections page:

http://udscanada.com/collections/acrylics

0 Likes
Highlighted
Tourist
8 0 3

Worked for me. Code was elsewhere due to the teme I'm using though (Outofthesandbox)

0 Likes