Solved

Hide Price on Collection Page for Studio 2.0 Theme

anitabanita11
Tourist
15 0 1

I need to be able to hide the price on the collection pages for specific products. I have edited the code based on other recommendations in the forum, but it has hid all product prices not the specific ones. 

 

There are two ways that the products are separated and can be identified:

Products that must have their price HIDDEN on the collections page are using the "in-store-only" page template and

 are NOT in the "online" collection (linked below).

https://honeyfawn.com.au/collections/online 

 

I have sorted the price showing on the product page, I just need the collection pages sorted!!

 

Please help!!

Accepted Solution (1)
EBOOST
Shopify Partner
810 222 250

This is an accepted solution.

Hi @anitabanita11 

May I suggest to update code these steps:

1. Go to each product that you would like to hide price after that add "in-store-only" tag

EBOOST_0-1672298146787.png

2. Go to Store Online-> theme -> edit code

3. Snippets/card-product.liquid

4. Add code below to top file

{%  assign hidePrice = false %}
{%  if  card_product.tags contains 'in-store-only' %}
  {%  assign hidePrice = true %}
{%  endif  %}

5. Find 

{% render 'price', product: card_product, price_class: '' %}

replace with code below

{%  unless hidePrice %} 
            {% render 'price', product: card_product, price_class: '' %}
{%  endunless %}

 

Hope can help


If you find my reply helpful, please hit Like and Mark as Solution


https://www.eboosttech.net


EBOOST

View solution in original post

Replies 6 (6)

EBOOST
Shopify Partner
810 222 250

Hi @anitabanita11 

Maybe I suggest you add "in-store-only" tag to products that you want to hide after that use liquid to check to hide price.

Hope can help


If you find my reply helpful, please hit Like and Mark as Solution


https://www.eboosttech.net


EBOOST
anitabanita11
Tourist
15 0 1
Thanks. But that won’t solve the code issue. I need to know what code to have to hide the pricing
anitabanita11
Tourist
15 0 1

This is the code I'm currently using 

<style>
{% if collection.handle != 'online' %}
.card__information .price {
display: none !important;
}
{% endif %}
#shopify-section-template--15790987542750__1646917325a197e0ca .card__information .price {
display: block !important;
}
</style>

EBOOST
Shopify Partner
810 222 250

This is an accepted solution.

Hi @anitabanita11 

May I suggest to update code these steps:

1. Go to each product that you would like to hide price after that add "in-store-only" tag

EBOOST_0-1672298146787.png

2. Go to Store Online-> theme -> edit code

3. Snippets/card-product.liquid

4. Add code below to top file

{%  assign hidePrice = false %}
{%  if  card_product.tags contains 'in-store-only' %}
  {%  assign hidePrice = true %}
{%  endif  %}

5. Find 

{% render 'price', product: card_product, price_class: '' %}

replace with code below

{%  unless hidePrice %} 
            {% render 'price', product: card_product, price_class: '' %}
{%  endunless %}

 

Hope can help


If you find my reply helpful, please hit Like and Mark as Solution


https://www.eboosttech.net


EBOOST
anitabanita11
Tourist
15 0 1

That worked - thank you so much!!!

anitabanita11
Tourist
15 0 1