hide prices of products in a collection?

Solved
moe1044
Tourist
7 0 1

Hello

how can i hide prices of some products which are listed in a specific collection? like

coming soon collection without prices for products.

 

Im using the supply theme, if that matters

 

Thank you

Accepted Solutions (2)

Accepted Solutions
Ninthony
Shopify Partner
2272 342 937

This is an accepted solution.

You need to find the piece of the code in your collection.liquid file where it shows the price and use an unless statement around it. So something like:

 

{% unless collection.handle == "your-collection-handle" %}
<div class="product-price">
{{ product.price }}
</div>
{% endunless %}

This way it will show the price UNLESS it's the specified collection.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄

View solution in original post

Ninthony
Shopify Partner
2272 342 937

This is an accepted solution.

To find your collection handle go to the collection and then scroll to the bottom to the Search engine listing preview and click on "Edit website SEO", it'll show your url, title, and handle. Your handle is the last thing at the end of the url:

collection-handle-help.jpg

All handles are lowercase and spaces are separated by hyphens, special characters are not included. So whatever is there is exactly what you're going to need to copy and paste into the quotes of the unless statement.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄

View solution in original post

Replies 84 (84)
Tejas_Nadpara
Shopify Partner
1087 216 529

@moe1044 

 

No, It's not matter which theme you are using. You can hide products price in any theme and there are several way to do it.

I think product tags is the best option because you are taking about the coming soon product so I think you have also hide price as well as Add To Cart button on product page otherwise user can still able to see price and Add To Cart on product page.

For this solution you have to add special tag in product like "coming-soon" then you can apply the condition on product price, if product has 'coming-soon' tag then price not display for that. it require some tweaks with code and Liquid files, and if this is something you would not be comfortable with, I would advise you to reach out to one of Shopify Experts, or you can contact me by mail. As always, when making code changes to your theme, please remember to create a backup, in case you need to revert back to previous versions of the theme.

 

Thank you,

Tejas

Shopify Expert | Skype: tejas.nadpara
- Like and Mark as an Accepted Solution if reply helpful
- Feel free to contact me on support@hexaecommerce.com regarding any help
moe1044
Tourist
7 0 1

i was able to delete the prices on the product page.

 

Now im trying to delete the prices on the collection page.

 

I tried editing code at the product-grid-item-liquid for this problem.

 

Im guessing have to edit line 9 and 11 for the collection?

 

011dbabasdv.png

moe1044
Tourist
7 0 1

Im trying to hide the prices on collection(sectional) page.

 

I made alternate product template to hide the prices for the product page.

 

But i cant figure out how to make alternate collections page to hide the prices.

 

I dont want the prices listed under the picture because pricing will vary depending on options chosen.

 

i believe i need to edit product-grid-item.liquid

Screenshot (2).png

So I made alternate product-grid-item.liquid.

 

But i cant figure out the code to tell what collection to block the prices.

 

Ninthony
Shopify Partner
2272 342 937

This is an accepted solution.

You need to find the piece of the code in your collection.liquid file where it shows the price and use an unless statement around it. So something like:

 

{% unless collection.handle == "your-collection-handle" %}
<div class="product-price">
{{ product.price }}
</div>
{% endunless %}

This way it will show the price UNLESS it's the specified collection.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
PrintedDream
Excursionist
12 0 2

@NinthonyThank you for your amazing answer! However, I'm suck pretty hard at coding, where do I have to add the unless statement in this case/what do I exactly have to do?

unless preis.png

 

Thank you very much! 🙂

 

- Nicolas

Ninthony
Shopify Partner
2272 342 937

Pretty sure you could do it around the include:

 

{% unless collection.handle == 'your-collection-handle' %}
  {% include 'product-price' %}
{% endunless %}
If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
PrintedDream
Excursionist
12 0 2

I really appreciate your answer, but I'm afraid I suck too hard at coding lol ._.

 

Do I just put this line

{% unless collection.handle == 'your-collection-handle' %}

 in front of the 'include product price' line & after that this line

{% endunless %}

or is there more to it?

Sorry for the inconveniences my man

Ninthony
Shopify Partner
2272 342 937

Yeah, just like I posted, it should look exactly like this. Lets say for example your collection was called "T Shirts" -- right now it looks like this:

 

{% include 'product-price' %}

Just replace that with:

{% unless collection.handle == "t-shirts" %}
  {% include 'product-price' %}
{% endunless %}

 

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
PrintedDream
Excursionist
12 0 2

Preis raus 2.png

Well, my Category is called ,,Wie funktioniert's?" & I did everything you told me to, but for some reason the price still gets displayed 😕

Any idea?

Ninthony
Shopify Partner
2272 342 937

This is an accepted solution.

To find your collection handle go to the collection and then scroll to the bottom to the Search engine listing preview and click on "Edit website SEO", it'll show your url, title, and handle. Your handle is the last thing at the end of the url:

collection-handle-help.jpg

All handles are lowercase and spaces are separated by hyphens, special characters are not included. So whatever is there is exactly what you're going to need to copy and paste into the quotes of the unless statement.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
PrintedDream
Excursionist
12 0 2

Ah, right, my bad!

 

However, after copying the handle & inserting it, the price still gets displayed..

Now I really don't know what the problem could be anymore 😕

Ninthony
Shopify Partner
2272 342 937

You can message me your store url and I can request access and take a look at it for you if you'd like.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
PrintedDream
Excursionist
12 0 2

That would be absolutely amazing, if you could do that it would be huge! 🙂

 

My store URL is https://printeddream.de/

 

Thank you for your efforts!

Ninthony
Shopify Partner
2272 342 937

Its no problem, I requested access.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
Ninthony
Shopify Partner
2272 342 937

Alright, I found the spot. You had to edit it in your product-card-grid.liquid and product-card-list.liquid snippets. I added the condition to both of them in the case you ever switch to a list in the settings.  I am not really sure where you are editing that collection.liquid, as the one on your current store only has an include inside it for collection-template.

 

Anyway, take a look at the Ninthony Editing theme, just preview it. If it looks fine to you, you can publish it.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
PrintedDream
Excursionist
12 0 2

Very interesting.. Thank you so much for your work, it means the world to me!

 

Wish you a wonderful evening & god bless,

 

Nick

Ninthony
Shopify Partner
2272 342 937

No problem, glad it helped. You can like my comments if you want 🙂 -- makes me feel accomplished

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
PrintedDream
Excursionist
12 0 2

That's the very least I could do for you my man!

PrintedDream
Excursionist
12 0 2

Ah, just thought of 1 more thing: If I introduce new categories in the future, if they include products that cost something, will the price be shown there? So, does the price-hiding only apply to this specific category we just edited? 🙂