Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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.
Hope someone can help. Thank you in advance!
.price.price--listing { display: none; }
Solved! Go to the solution
This is an accepted solution.
Hi @DDDigitalMS,
Please change code:
{% unless product_card_product.tags contains 'business-listing' %}
{% render 'price', product: product_card_product, price_class: '' %}
{% endunless %}
Hope it helps!
Hi @DDDigitalMS
From a very very quick look the CSS you need is this:
.card-information>.price {
display: none;
}
How you get that to only apply to certain collections is up to you.
Either edit the files directly in the theme.
Or potentially add the CSS in a Custom HTML section somewhere on that category template.
Hi @DDDigitalMS
For your code to work you need to use:
{% unless product.tags contains 'business-listing' %}
Price Code
{%endunless%}
That should do it!
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 @DDDigitalMS,
You have added the 'business-listing' tag to the products and want to hide the prices of the products with the 'business-listing' tag.
Go to product-card.liquid file, find "render 'price'" and add code:
Code:
{% unless product.tags contains 'business-listing' %}
{% render 'price', product: product_card_product, price_class: '' %}
{% endunless %}
Hope it helps!
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.
Do you have any other ideas I could try?
This is an accepted solution.
Hi @DDDigitalMS,
Please change code:
{% unless product_card_product.tags contains 'business-listing' %}
{% render 'price', product: product_card_product, price_class: '' %}
{% endunless %}
Hope it helps!
@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:
{% unless card_product.tags contains 'business-listing' %}
{% render 'price', product: product_card_product, price_class: '' %}
{% endunless %}
See LitExtensions originally response on this thread for where to insert the code and please be sure to give them a Like for their help!
worked perfectly, but I had to adapt
{% render 'price', product: product_card_product, price_class: '' %}
to
{% render 'price', product: card_product, price_class: '' %}
in my Dawn 2.0
thanks for the code!
This worked. Thank you!
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. 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"
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.
Appreciate any response.
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
Hi! Could you pls tell if you find the way how to display "call for rice" on product page of specific collection?
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.
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024