FROM CACHE - en_header

How to hide prices on sold items?

Solved
nys_nicolas
New Member
9 0 0

Hi there, im using the brooklyn theme and want to hide my prices on sold items.
This way i can keep them on my webshop.
Thank you!

Accepted Solution (1)

Accepted Solutions
Visely-Team
Shopify Partner
1843 210 476

This is an accepted solution.

Well, it might depend on the version of the Brooklyn theme you are using, but you can try adding this snippet to the bottom of your assets/timber.scss.liquid:

.is-sold-out .grid-product__price-wrap { display: none; }
Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog

View solution in original post

Replies 5 (5)
Visely-Team
Shopify Partner
1843 210 476

This is an accepted solution.

Well, it might depend on the version of the Brooklyn theme you are using, but you can try adding this snippet to the bottom of your assets/timber.scss.liquid:

.is-sold-out .grid-product__price-wrap { display: none; }
Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
nys_nicolas
New Member
9 0 0

Sweet that works, but if you click on the product you can still see the product price.
How is this possible to remove this ?
Thanks!

nys_nicolas
New Member
9 0 0

Sweet that works, but if you click on the product you can still see the product price.
How is this possible to remove this ?
Thanks!

StephenK
Shopify Partner
71 7 34

If you want a liquid solution instead you can wrap you price HTML in this:-

 

{%- if product.available == true -%}
YOUR PRICE CODE
{%- endif -%}

https://shopify.dev/docs/themes/liquid/reference/objects/product#product-available

 

 

If you wanted to hide certain variants on a product you could also use:-

 

{%- if variant.available == true -%}
YOUR PRICE CODE
{%- endif -%}

https://shopify.dev/docs/themes/liquid/reference/objects/variant/#variant-available 

 

Both of these mean it would only show the price if the product/variant is available for purchase. You can also extend this to add else clauses to maybe show a Sold Out message.

Some Shopify/Ecommerce related articles - https://medium.com/@stephenkeable
Brooklyyn
New Member
2 0 0

Hello, 

 

I was able to hide the sold out price on the product page, but when I paste in the above code to the timber.scss.liquid the prices on sold out items still show up on collection, home & search pages. Not sure what I'm missing here, please advise if possible! Thank you!