Empire Theme - HIDE Price on Collections Page if Price is $0.00

We are currently using the Empire Theme by PixelUnion.

We have several products that we are not allowed to display the price for on line.

Manufacturer requires “Sold In Store Only - Please contact for details” I want to make sure our customer know these items are available, they just have to contact us for pricing.

I can handle not showing the price on the product pages but for the life of me I can’t figure out how to hide the price on the collections pages.

Any advice or direction would be greatly appreciated.

Hi @DicksonBros ,

Please send me the code of card-product.liquid file, I will check and guide it

@DicksonBros if you are familiar with coding then you can check product card file where you can compare prices and display price only if it is not 0.00, are you familiar with liquid code?

here is the code from product-price.liquid

{% comment %}
  @param class_root {String}
    Base class root

  @param show_range {Bool}
    Show price range

  @param price_range_format {String}
    'range' or 'from', defaults to 'range'

  @param product {Product}
    Product to reference for price

  @param compare_at_price_varies {Bool}
    Displays a range price if a product's variants have differing prices

  @param on_sale {Bool}
    If a product, or one of it's variants is on sale

  @param emphasize_price {Bool}
    Used in product grid item to add placeholder space

  @param show_original {Bool}
    Show original price if is consistent across all variants

  @param show_savings {Bool}
    Line of text indicating maximum savings on sale items (ex. "Save up to 20%")

  @param savings_format {String}
    Percentage or money for show_savings line
{% endcomment %}

{% assign include_hidden_price = include_hidden_price | default: true %}
{% comment %}Inject /shopify-price-ui/price begin{% endcomment %}
{% comment %}
  @param class_root {String}
    Base class root

  @param show_range {Bool}
    Show price range

  @param price_varies {Boolean}
    If true, the variant price varies

  @param compare_at_price_varies {Boolean}
    If true, the variant compare price varies

  @param price_range_format {String}
      'range' or 'from', defaults to 'range'

  @param product {Product}
      Product to reference for price

  @param on_sale {Bool}
    If a product, or one of it's variants is on sale

  @param emphasize_price {Bool}
    Used in product grid item to add placeholder space

  @param show_original {Bool}
    Show original price if is consistent across all variants

  @param show_savings {Bool}
    Line of text indicating maximum savings on sale items (ex. "Save up to 20%")

  @param savings_format {String}
    Percentage or money for show_savings line

  @param include_spacer {Bool}
    Include a spacer div above the price when emphasize price is enabled and there is no 'compare-at' price

  @param include_unit_price
    Include the unit price line

  @param include_tax_line
    Include tax line

  @param include_hidden_price
    Include a hidden element with price data to use in cases of unavailable variants or cases where no variant
    is selected by default

  @param include_compare_price
    Show compare at price
{% endcomment %}

{% assign price_min = nil %}
{% assign price_max = nil %}
{% assign compare_at_price_min = nil %}
{% assign compare_at_price_max = nil %}
{% assign price_varies = price_varies | default: false %}
{% assign compare_at_price_varies = compare_at_price_varies | default: false %}

{% for variant in product.variants %}
  {% if price_min == nil or variant.price < price_min %}
    {% assign price_min = variant.price %}
  {% endif %}
  {% if price_max == nil or variant.price > price_max %}
    {% assign price_max = variant.price %}
  {% endif %}
  {% assign tmp_compare_at_price = variant.compare_at_price %}
  {% unless variant.compare_at_price %}
    {% assign tmp_compare_at_price = variant.price %}
  {% endunless %}
  {% if compare_at_price_min == nil or tmp_compare_at_price < compare_at_price_min %}
    {% assign compare_at_price_min = tmp_compare_at_price %}
  {% endif %}
  {% if compare_at_price_max == nil or tmp_compare_at_price > compare_at_price_max %}
    {% assign compare_at_price_max = tmp_compare_at_price %}
  {% endif %}
{% endfor %}

{% assign show_range = show_range | default: false %}
{% assign price = price | default: product.price %}
{% assign compare_at_price = compare_at_price | default: product.compare_at_price %}
{% assign variants = product.variants %}
{% assign price_range_format = price_range_format | default: 'range' %}
{% assign savings_format = savings_format | default: 'percentage' %}
{% assign on_sale = on_sale | default: false %}
{% assign emphasize_price = emphasize_price | default: false %}
{% assign show_original = show_original | default: false %}
{% assign show_savings = show_savings | default: false %}
{% assign class_root = class_root | default: 'product' %}
{% assign include_spacer = include_spacer | default: false %}
{% assign include_unit_price = include_unit_price | default: false %}
{% assign include_tax_line = include_tax_line | default: false %}
{% assign include_compare_price = include_compare_price | default: true %}

  {% if include_compare_price %}
    

      {%- capture compare_at_price_html -%}
        {{ 'product_price.price.original' | t }}
        
          {{ compare_at_price | money }}
        
      {%- endcapture -%}

      {% if compare_at_price_varies %}
        {%- capture compare_at_price_range_html -%}
          {% if price_range_format == 'range' %}
            {{ 'product_price.price.original' | t }}
            
              {{ compare_at_price_min | money }}
            
            -
            {{ 'product_price.price.original' | t }}
            
              {{ compare_at_price_max | money }}
            
          {% else %}
            {{ 'product_price.item.price.range_html' | t: price: compare_at_price_html | strip_newlines }}
          {% endif %}
        {% endcapture %}
      {% endif %}

      {% if compare_at_price_varies and on_sale and show_original and show_range %}
        {{ compare_at_price_range_html }}
      {% elsif on_sale and show_original %}
        {{ compare_at_price_html }}
      {% elsif emphasize_price and include_spacer %}
        
      {% elsif show_original %}
        
      {% endif %}
    

    {% if include_hidden_price %}
      {% comment %}
        Hide an element containing compare at price info to fill in the price when no variant is selected
      {% endcomment %}
      
        {% if price_range_format == 'range' %}
          {{ 'product_price.price.original' | t }}
          
            {{ compare_at_price_min | money }}
          
          -
          {{ 'product_price.price.original' | t }}
          
            {{ compare_at_price_max | money }}
          
        {% else %}
          {{ 'product_price.item.price.range_html' | t: price: compare_at_price_html | strip_newlines }}
        {% endif %}
      

      
        {{ 'product_price.price.original' | t }}
        
          {{ compare_at_price | money }}
        
      

    {% endif %}
  {% endif %}

  
    {%- capture price_html -%}
      
        {{ price | money }}
      
    {%- endcapture -%}

    {% capture current_price_range_html %}
      {% if price_varies %}
        {% if price_range_format == 'range' %}
          {{ price_min | money}}
          -
          {{ price_max | money }}
        {% else %}
          {{ 'product_price.price.range_html' | t: price: price_html | strip_newlines }}
        {% endif %}
      {% endif %}
    {% endcapture %}

    {% capture current_price_html %}
      {% if on_sale and show_original %}
        {{ 'product_price.price.current' | t }}
      {% endif %}
      {{ price_html }}
    {% endcapture %}

    {% if show_range and price_varies %}
      {{ current_price_range_html }}
    {% else %}
      {{ current_price_html }}
    {% endif %}
  

  {% if include_hidden_price %}
    {% comment %}
      Hide an element containing current price info to fill in the price when no variant is selected
    {% endcomment %}
    
      {% if price_range_format == 'range' %}
        {{ price_min | money}}
        -
        {{ price_max | money }}
      {% else %}
        {{ 'product_price.price.range_html' | t: price: price_html | strip_newlines }}
      {% endif %}
    

    
      {{ 'product_price.price.current' | t }}
      {{ price_html }}
    

  {% endif %}

  {% if include_unit_price %}
    {% assign variant = product.selected_or_first_available_variant %}
    {% capture total_quantity %}{{ variant.unit_price_measurement.quantity_value }}{{ variant.unit_price_measurement.quantity_unit }}{% endcapture %}
    {% capture unit_price %}{{ variant.unit_price | money }}{% endcapture %}
    {% capture unit_measure %}{%- if variant.unit_price_measurement.reference_value != 1 -%}{{ variant.unit_price_measurement.reference_value }}{%- endif %}{{ variant.unit_price_measurement.reference_unit }}{% endcapture %}

    

      {{ 'product_price.price.price_per_unit_html' | t: total_quantity: total_quantity, unit_price: unit_price, unit_measure: unit_measure | strip_newlines }}
    

  {% endif %}

  {% if include_tax_line %}
    {%- capture tax_text -%}
      {{ 'product_price.price.tax_line_html' | t }}
    {%- endcapture -%}

    {%- if tax_text != blank and class_root != 'productitem' -%}
      
        {{ tax_text }}
      

    {%- endif -%}
  {% endif %}

{% comment %}Inject /shopify-price-ui/price end{% endcomment %}

Hi @DicksonBros ,

Please change all code:

{% comment %}
  @param class_root {String}
    Base class root

  @param show_range {Bool}
    Show price range

  @param price_range_format {String}
    'range' or 'from', defaults to 'range'

  @param product {Product}
    Product to reference for price

  @param compare_at_price_varies {Bool}
    Displays a range price if a product's variants have differing prices

  @param on_sale {Bool}
    If a product, or one of it's variants is on sale

  @param emphasize_price {Bool}
    Used in product grid item to add placeholder space

  @param show_original {Bool}
    Show original price if is consistent across all variants

  @param show_savings {Bool}
    Line of text indicating maximum savings on sale items (ex. "Save up to 20%")

  @param savings_format {String}
    Percentage or money for show_savings line
{% endcomment %}

{% assign include_hidden_price = include_hidden_price | default: true %}
{% comment %}Inject @pixelunion/shopify-price-ui/price begin{% endcomment %}
{% comment %}
  @param class_root {String}
    Base class root

  @param show_range {Bool}
    Show price range

  @param price_varies {Boolean}
    If true, the variant price varies

  @param compare_at_price_varies {Boolean}
    If true, the variant compare price varies

  @param price_range_format {String}
      'range' or 'from', defaults to 'range'

  @param product {Product}
      Product to reference for price

  @param on_sale {Bool}
    If a product, or one of it's variants is on sale

  @param emphasize_price {Bool}
    Used in product grid item to add placeholder space

  @param show_original {Bool}
    Show original price if is consistent across all variants

  @param show_savings {Bool}
    Line of text indicating maximum savings on sale items (ex. "Save up to 20%")

  @param savings_format {String}
    Percentage or money for show_savings line

  @param include_spacer {Bool}
    Include a spacer div above the price when emphasize price is enabled and there is no 'compare-at' price

  @param include_unit_price
    Include the unit price line

  @param include_tax_line
    Include tax line

  @param include_hidden_price
    Include a hidden element with price data to use in cases of unavailable variants or cases where no variant
    is selected by default

  @param include_compare_price
    Show compare at price
{% endcomment %}

{% assign price_min = nil %}
{% assign price_max = nil %}
{% assign compare_at_price_min = nil %}
{% assign compare_at_price_max = nil %}
{% assign price_varies = price_varies | default: false %}
{% assign compare_at_price_varies = compare_at_price_varies | default: false %}

{% for variant in product.variants %}
  {% if price_min == nil or variant.price < price_min %}
    {% assign price_min = variant.price %}
  {% endif %}
  {% if price_max == nil or variant.price > price_max %}
    {% assign price_max = variant.price %}
  {% endif %}
  {% assign tmp_compare_at_price = variant.compare_at_price %}
  {% unless variant.compare_at_price %}
    {% assign tmp_compare_at_price = variant.price %}
  {% endunless %}
  {% if compare_at_price_min == nil or tmp_compare_at_price < compare_at_price_min %}
    {% assign compare_at_price_min = tmp_compare_at_price %}
  {% endif %}
  {% if compare_at_price_max == nil or tmp_compare_at_price > compare_at_price_max %}
    {% assign compare_at_price_max = tmp_compare_at_price %}
  {% endif %}
{% endfor %}

{% assign show_range = show_range | default: false %}
{% assign price = price | default: product.price %}
{% assign compare_at_price = compare_at_price | default: product.compare_at_price %}
{% assign variants = product.variants %}
{% assign price_range_format = price_range_format | default: 'range' %}
{% assign savings_format = savings_format | default: 'percentage' %}
{% assign on_sale = on_sale | default: false %}
{% assign emphasize_price = emphasize_price | default: false %}
{% assign show_original = show_original | default: false %}
{% assign show_savings = show_savings | default: false %}
{% assign class_root = class_root | default: 'product' %}
{% assign include_spacer = include_spacer | default: false %}
{% assign include_unit_price = include_unit_price | default: false %}
{% assign include_tax_line = include_tax_line | default: false %}
{% assign include_compare_price = include_compare_price | default: true %}
{%- if price == 0 -%}
  
    Sold In Store Only - Please contact for details
  

{%- else -%}

  {% if include_compare_price %}
    

      {%- capture compare_at_price_html -%}
        {{ 'product_price.price.original' | t }}
        
          {{ compare_at_price | money }}
        
      {%- endcapture -%}

      {% if compare_at_price_varies %}
        {%- capture compare_at_price_range_html -%}
          {% if price_range_format == 'range' %}
            {{ 'product_price.price.original' | t }}
            
              {{ compare_at_price_min | money }}
            
            -
            {{ 'product_price.price.original' | t }}
            
              {{ compare_at_price_max | money }}
            
          {% else %}
            {{ 'product_price.item.price.range_html' | t: price: compare_at_price_html | strip_newlines }}
          {% endif %}
        {% endcapture %}
      {% endif %}

      {% if compare_at_price_varies and on_sale and show_original and show_range %}
        {{ compare_at_price_range_html }}
      {% elsif on_sale and show_original %}
        {{ compare_at_price_html }}
      {% elsif emphasize_price and include_spacer %}
        
      {% elsif show_original %}
        
      {% endif %}
    

    {% if include_hidden_price %}
      {% comment %}
        Hide an element containing compare at price info to fill in the price when no variant is selected
      {% endcomment %}
      
        {% if price_range_format == 'range' %}
          {{ 'product_price.price.original' | t }}
          
            {{ compare_at_price_min | money }}
          
          -
          {{ 'product_price.price.original' | t }}
          
            {{ compare_at_price_max | money }}
          
        {% else %}
          {{ 'product_price.item.price.range_html' | t: price: compare_at_price_html | strip_newlines }}
        {% endif %}
      

      
        {{ 'product_price.price.original' | t }}
        
          {{ compare_at_price | money }}
        
      

    {% endif %}
  {% endif %}

  
    {%- capture price_html -%}
      
        {{ price | money }}
      
    {%- endcapture -%}

    {% capture current_price_range_html %}
      {% if price_varies %}
        {% if price_range_format == 'range' %}
          {{ price_min | money}}
          -
          {{ price_max | money }}
        {% else %}
          {{ 'product_price.price.range_html' | t: price: price_html | strip_newlines }}
        {% endif %}
      {% endif %}
    {% endcapture %}

    {% capture current_price_html %}
      {% if on_sale and show_original %}
        {{ 'product_price.price.current' | t }}
      {% endif %}
      {{ price_html }}
    {% endcapture %}

    {% if show_range and price_varies %}
      {{ current_price_range_html }}
    {% else %}
      {{ current_price_html }}
    {% endif %}
  

  {% if include_hidden_price %}
    {% comment %}
      Hide an element containing current price info to fill in the price when no variant is selected
    {% endcomment %}
    
      {% if price_range_format == 'range' %}
        {{ price_min | money}}
        -
        {{ price_max | money }}
      {% else %}
        {{ 'product_price.price.range_html' | t: price: price_html | strip_newlines }}
      {% endif %}
    

    
      {{ 'product_price.price.current' | t }}
      {{ price_html }}
    

  {% endif %}

  {% if include_unit_price %}
    {% assign variant = product.selected_or_first_available_variant %}
    {% capture total_quantity %}{{ variant.unit_price_measurement.quantity_value }}{{ variant.unit_price_measurement.quantity_unit }}{% endcapture %}
    {% capture unit_price %}{{ variant.unit_price | money }}{% endcapture %}
    {% capture unit_measure %}{%- if variant.unit_price_measurement.reference_value != 1 -%}{{ variant.unit_price_measurement.reference_value }}{%- endif %}{{ variant.unit_price_measurement.reference_unit }}{% endcapture %}

    

      {{ 'product_price.price.price_per_unit_html' | t: total_quantity: total_quantity, unit_price: unit_price, unit_measure: unit_measure | strip_newlines }}
    

  {% endif %}

  {% if include_tax_line %}
    {%- capture tax_text -%}
      {{ 'product_price.price.tax_line_html' | t }}
    {%- endcapture -%}

    {%- if tax_text != blank and class_root != 'productitem' -%}
      
        {{ tax_text }}
      

    {%- endif -%}
  {% endif %}

{%- endif -%}
{% comment %}Inject @pixelunion/shopify-price-ui/price end{% endcomment %}

yeah that didn’t work. When I used your code it removed everything from the collections page.

Hi @DicksonBros ,

I tried it on my store and it works fine.

Can I send you a collaborator invitation? I will check it.

sure! dicksonbrothers.com

Hi @DicksonBros ,

Please send me the collaborator code in private message, I will send you the invitation and check it

message sent