A user seeks to hide product prices on collection pages for items tagged ‘business-listing’ in the Dawn theme, as they’re building a business directory using products.
Solution Found:
The working code involves editing the product-card.liquid file by wrapping the price render statement with a conditional tag check:
I am creating a new website using the Dawn theme (not live yet so cannot share a link) which includes a business directory. I think listing each business as a product is the best way to do this, but I need to remove the prices on the collection and homepages for the product cards.
Could anyone please help me with this? Ideally, I need to add code which will only exclude prices if they include the tag ‘business-listing’, as the website will also feature actual products.
I am using Dawn OS2.0 theme and have created a separate collection page template for the business directory listings. I’m not sure whether I need to paste code into css, a snippet file, or somewhere else. I have found a thread that suggested the code below in css, but this did not work for me.
Thank you so much @JHKCreate ! Can you please tell me where I need to put this code? I tried adding it to the end of template-collection.css but it hasn’t worked
Hi @LitExtension , Thank you for this. Unfortunately it hasn’t worked. I followed your instructions exactly, added business-listing as a tag to the products I want to hide prices on, copied the exact code you gave, but I can still see the prices. I’ve done a hard refresh and tried opening in incognito, but they’re still there.
@LitExtension Thank you soooo much!!! It didn’t quite work, so I tried changing product_card_product.tags to card_product.tags in that first line and it’s worked perfectly!!
Thank you so much for your time helping with this. I’m so incredibly grateful!
To confirm for anyone else reading this, the final code that worked for me in Dawn 2.0 theme, kindly provided by @LitExtension is:
the code worked for removing price on collection pages, but is there a way to also remove on product page? and is there a code for “if” product tag contains “example” then the price displayed would say “Call for Price” instead of removing.
I tackled this part by creating a seperate product template in the theme editor, then removing the Price and checkout buttons etc. Any business listings are now set to the new template I created within the product area on the Templates drop down, while any advertising products are left with the default product theme template
Thanks.. I understand the new product template can work for the product page.. But im trying to see if i can display ‘Call for Price’ instead of removing the block entirely for both collection and product page
Is there a way to make this work for specific products in multiple collections? EX: I have a "sale"vcategory and would like the price hidden from the product card.
Hi. For the product page, i was able to create a new product template and removed the section for Price / buy now buttons and inserted a rich text section that manually i wrote “Call for Price” - then for each product i add, i can choose which template to use.
BUT
i still haven’t found out how i could code the collection page results to display “Call for Price” on specific items (based on a specific tag) so when i browse the collection, the price still appears.
if you figure out the collection page code that is needed, please indicate. Thanks.
Hi. Could you please point out where I can add the code ? I can’t find the right product card liquid file; is it called different in my Motion theme? I would like to hide the price for product containing tag “businesslisting”