Change 'from' starting price on product card/collection pages (Halothemes)

Currently my product card shows price as “from £0.00” - but the £0.00 option is a sample and it looks weird on the collection page that all my products are £0.

I’m struggling with how to display a different variant price. The theme is from Halothemes so the suggestions on other similar threads don’t work for me as the liquid is very different.

I am able to edit the language of my theme but when I change the {{ price }} to anything else it tells me there is a missing interpolation and isn’t able to link any data.

This is currently the liquid code in my theme, under the snippet product-card.liquid:

{%- if show_price -%}

{% render 'price', product: product_card_product, price_class: '', hasCountdown: hasCountdown %}
{%- endif -%}

I’ve tried altering this and it makes no difference. I can’t seem to find the snippet that I need that would link to a variant price rather than the base price.

Any help would be appreciated because this is driving me mad!

Thank you

Hey @smcc17 ,

Thanks for reaching out. I understand you’re seeing the “from £0.00” pricing issue and getting interpolation errors when trying to modify the theme. Here’s a solution that should resolve it.

  1. Update the product-card.liquid snippet by replacing the price section with this:

    {%- if show_price -%}
      <div class="card-price">
        {%- assign current_variant = product_card_product.selected_or_first_available_variant -%}
        {% render 'price',
          product: product_card_product,
          variant: current_variant,
          price_class: '',
          hasCountdown: hasCountdown
        %}
      </div>
    {%- endif -%}
    
  2. Make sure your price.liquid snippet exists (or create it) and update it with this:

    {%- assign variant_price = variant.price | default: product.price -%}
    {%- assign compare_price = variant.compare_at_price | default: product.compare_at_price -%}
    
    <div class="price {% if price_class %}{{ price_class }}{% endif %}">
      <span class="price__regular">
        <span class="visually-hidden">Regular price</span>
        <span class="price-item price-item--regular">
          {{ variant_price | money }}
        </span>
      </span>
    
      {%- if compare_price > variant_price -%}
        <span class="price__sale">
          <span class="visually-hidden">Sale price</span>
          <span class="price-item price-item--sale">
            {{ variant_price | money }}
          </span>
        </span>
      {%- endif -%}
    </div>
    

Things to check before implementing:

  • Make sure all your products have correct pricing set in Shopify.
  • Confirm that price.liquid exists in your snippets folder.
  • Check if product_card_product is passed correctly in the theme files.
  • Clear your theme cache after making these updates.

If you’re still seeing interpolation errors, it’s possible that Halothemes requires a specific price object structure. It’s always a good idea to back up your theme and test these changes on a development version first.

This should work but If you still run into issues, let me know :slightly_smiling_face:

Cheers,
Shubham | Untechnickle

Hi, thank you so much for your reply. This has removed the ‘from’ but the price is still showing as £0.00

It also keeps the price as £0.00 when a variant is selected

Thank you for the update. Let’s solve the £0.00 pricing issue. This typically happens when either the variant prices aren’t being properly fetched or when the default price isn’t falling back correctly.

Let’s modify the price snippet to debug and ensure we’re getting the correct prices:

{%- comment -%}
  Debug information and price handling
{%- endcomment -%}
{%- assign variant_price = variant.price | default: product.price -%}
{%- assign first_variant = product.first_available_variant -%}
{%- assign min_price = product.price_min -%}

<div class="price {% if price_class %}{{ price_class }}{% endif %}">
  {%- if first_variant -%}
    <span class="price__regular">
      <span class="price-item price-item--regular">
        {%- if first_variant.price > 0 -%}
          {{ first_variant.price | money }}
        {%- else -%}
          {{ min_price | money }}
        {%- endif -%}
      </span>
    </span>
  {%- else -%}
    <span class="price__regular">
      <span class="price-item price-item--regular">
        {{ min_price | money }}
      </span>
    </span>
  {%- endif -%}
</div>

And in your product-card.liquid, let’s modify it to ensure we’re passing the correct variant:

{%- if show_price -%}
  <div class="card-price">
    {%- assign default_variant = product_card_product.first_available_variant | default: product_card_product.variants.first -%}
    {% render 'price',
      product: product_card_product,
      variant: default_variant,
      price_class: '',
      hasCountdown: hasCountdown
    %}
  </div>
{%- endif -%}

Could you also check a few things in your Shopify admin:

  1. Go to one of your products that’s showing £0.00
  2. Check the “Variants” tab
  3. Verify that the variant prices are set correctly (not 0)
  4. Make sure the variants are marked as “Available” if they should be in stock

Also, could you let me know:

  1. Are all products showing £0.00 or just some?
  2. When you view the product detail page, does it show the correct price?

This will help me pinpoint exactly where the price calculation is failing. If it’s comfortable you can DM your collaborator code and our team of experts will fix this in no time.

Thanks,

Shubham | Untechnickle

I have sent you a DM, thank you so much

Hey @smcc17 ,

Fixed it! :slightly_smiling_face:

Here’s the modified code of price.liquid:

{%- comment -%}
    Renders a list of product's price (regular, sale)

    Accepts:
    - product: {Object} Product Liquid object (optional)
    - use_variant: {Boolean} Renders selected or first variant price instead of overall product pricing (optional)
    - show_badges: {Boolean} Renders 'Sale' and 'Sold Out' tags if the product matches the condition (optional)
    - price_class: {String} Adds a price class to the price element (optional)

    Usage:
    {% render 'price', product: product %}
{%- endcomment -%}
{%- liquid
    if use_variant
        assign target = product.selected_or_first_available_variant
    else
        assign target = product
    endif

    # Handle pricing differently for collection vs product pages
    if template contains 'collection'
        # Get the minimum non-zero price from variants for collection pages
        assign min_price = 999999999
        for variant in product.variants
            if variant.price > 0 and variant.price < min_price
                assign min_price = variant.price
            endif
        endfor

        # If we found a non-zero price, use it, otherwise fall back to default price
        if min_price < 999999999
            assign price = min_price
        else
            assign price = target.price | default: 1999
        endif
    else
        # For product pages and other templates, use the regular price
        assign price = target.price | default: 1999
    endif

    assign compare_at_price = target.compare_at_price
    assign available = target.available | default: false

    if settings.currency_format_enable
        assign money_price = price | money_with_currency
    else
        assign money_price = price | money
    endif 

    if target == product and product.price_varies
        assign money_price = 'products.product.price.from_price_html' | t: price: money_price
    endif
-%}

    <dl>
        {%- comment -%}
          Explanation of description list:
            - div.price__regular: Displayed when there are no variants on sale
            - div.price__sale: Displayed when a variant is a sale
            - div.price__availability: Displayed when the product is sold out
        {%- endcomment -%}
        

            {%- comment -%}
                <dt>
                    {{ 'products.product.price.regular_price' | t }}
                </dt>
            {%- endcomment -%}
            <dd>{{ money_price }}</dd>
        

        
            {%- comment -%}
                <dt>
                    {{ 'products.product.price.regular_price' | t }}
                </dt>
            {%- endcomment -%}
            
            <dd>~~{% if settings.currency_format_enable %}{{ compare_at_price | money_with_currency }}{% else %}{{ compare_at_price | money }}{% endif %}~~</dd>
            {%- comment -%}
                <dt>
                    {{ 'products.product.price.sale_price' | t }}
                </dt>
            {%- endcomment -%}
            <dd>{{ money_price }}</dd>
            {%- if settings.show_saved_price and price != nil and price != blank and compare_at_price != nil and compare_at_price != blank -%}
                {%- assign saved_price = compare_at_price | minus: price | money -%}
                {{'products.product.price.saved_price_html' | t: price: saved_price }}

            {%- endif -%}

            {%- if settings.show_price_percent -%}
            <dd>
                {%- liquid 
                    assign list_compare = product.variants | where: 'compare_at_price'
                    assign compare = 0
                    for variant in list_compare
                        assign saving = variant.compare_at_price | minus: variant.price | times: 100.0 | divided_by: variant.compare_at_price | round
                        if saving > compare
                            assign compare = saving
                        endif
                    endfor
                    if compare  < 1
                        assign compare = product.compare_at_price_min | minus: product.price_min | times: 100.0 | divided_by: product.compare_at_price_min | round
                    endif
                -%}(-{{ compare | append: '%'}})
            </dd>
            {%- endif -%}
        

        <small>
            <dt>{{ 'products.product.price.unit_price' | t }}</dt>
            <dd>{{- product.selected_or_first_available_variant.unit_price | money -}}/ {{ 'accessibility.unit_price_separator' | t }} {%- if product.selected_or_first_available_variant.unit_price_measurement.reference_value != 1 -%}
                        {{- product.selected_or_first_available_variant.unit_price_measurement.reference_value -}}{%- endif -%} {{ product.selected_or_first_available_variant.unit_price_measurement.reference_unit }}</dd>
        </small>
    </dl>

Cheers!
Shubham | Untechnickle

1 Like