Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
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
Solved! Go to the solution
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.
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:
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.
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
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?
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
So I made alternate product-grid-item.liquid.
But i cant figure out the code to tell what collection to block the prices.
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.
@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?
Thank you very much! 🙂
- Nicolas
Pretty sure you could do it around the include:
{% unless collection.handle == 'your-collection-handle' %} {% include 'product-price' %} {% endunless %}
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
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 %}
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?
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:
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.
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 😕
You can message me your store url and I can request access and take a look at it for you if you'd like.
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!
Its no problem, I requested access.
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.
Very interesting.. Thank you so much for your work, it means the world to me!
Wish you a wonderful evening & god bless,
Nick
No problem, glad it helped. You can like my comments if you want 🙂 -- makes me feel accomplished
That's the very least I could do for you my man!
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? 🙂
User | RANK |
---|---|
210 | |
109 | |
83 | |
60 | |
51 |