How can I hide the price in Simple Theme for a specific collection?

Hello,

Is someone able to direct me how I could hide the price in Simple Theme on a collection?

From some old posts it was under theme.scss.liquid but that is deprecatted for support and so not sure this is still the right place. This old post made me think I could write it in liquid code between comment boxes. https://community.shopify.com/c/Shopify-Design/Hide-prices-from-collection-view-and-featured-collection-in-quot/td-p/318056

I admit I don’t know liquid well. It would only be for a specific collection so I assume based on the collection name or product tag within the code?

Any advice or example code would be really helpful to me.

Thanks in advance.

Hi Dan,

Hope you’re doing well.

In order to hide the price on a specific collection in liquid different theme might require different solutions.

I will do an example with the debut theme.

In the Debut theme there is a product-card-grid and a product-card-list snippet depending on the way you chose to display your products.

For the sake of this example we will demonstrate how to do the fix on the product-card-grid.liquid file.

When you look at the code in the file you can see this at the bottom of the file:

{{ product.title }}

      {% include 'product-price-listing', product: product, show_vendor: show_vendor %}

We can see that the product-price-listing responsible for the display of the products price.

Hence, removing it would remove the price.

BUT, doing so would remove the price for all of the collections and we want to remove it only for one!

So we can add an if statement verifying if the collection IS NOT the one we want to remove the prices from.

In my example i took the frontpage collection.

Replace the “frontpage” by the handle of your collection in the code below and it should work fine!

Here is the solution:

{{ product.title }}

      {% if collection.handle != 'frontpage' %}
      {% include 'product-price-listing', product: product, show_vendor: show_vendor %}
      {% endif %}

Now the price will only display for products from collections that are NOT from the frontpage.

Don’t forget, it WILL still display in the product page

Hope this helps!

Thanks @ocoulombe for the quick response.

I found the snippet. This one does have a grid. I did some other shopify Googling and thought I could modify it slightly like such but this didn’t work for me. Now in ‘Awesome’ I thought I could list the price ie all the products are showing the same price of $1.00 but that didn’t do it. Any thoughts?

{% if collection.handle == 'grand-grill' %}
      {{ product.price | money | remove: 'Awesome' }}
      {% endif %}

As a follow up I was able to solve this.

Thanks @ocoulombe for your initial help to find the product-card-grid.liquid file

I found the part of the grid that called out pricing. Then added specific unless tags around that entire pricing section and it worked.


      {% unless collection.handle == 'grand-grill' %}
    {% if product.compare_at_price > product.price %}
      ADDITIONAL CODE NOT SHOWN HERE TO SAVE SPACE
    {% endif %}
    {% endunless %}
  

Glad that you were able to figure it out!

And yes unless brackets does the same as the proposed solution!

Thanks for the update!

Yes on that part of the code you made a little type writing “==” instead of “!=” that is probably why it did not work