Re: Hide price on specific collection pages - Dawn theme

Solved

Hide price on specific collection pages - Dawn theme

DDDigitalMS
Shopify Partner
24 0 13

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; }

DD Digital Marketing Services - UK
Shopify Website Build and Management | SEO | Marketing
Accepted Solution (1)
LitExtension
Shopify Partner
4860 1002 1160

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 - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify

View solution in original post

Replies 16 (16)

SB_90
Shopify Partner
216 52 70

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.

JHKCreate
Shopify Partner
3571 638 928

Hi @DDDigitalMS 

 

For your code to work you need to use:

{% unless product.tags contains 'business-listing' %}
Price Code
{%endunless%}

 

That should do it!

 

 

Did we solve your issue? Like & Mark As Solution to help the community
Should you need any direct help: contact@jhkcreate.com

Learn more about us: jhkcreate.com
DDDigitalMS
Shopify Partner
24 0 13

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

DD Digital Marketing Services - UK
Shopify Website Build and Management | SEO | Marketing
LitExtension
Shopify Partner
4860 1002 1160

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:

Screenshot.png

Code:

{% unless product.tags contains 'business-listing' %}
  {% render 'price', product: product_card_product, price_class: '' %}
{% endunless  %}

Hope it helps!

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
DDDigitalMS
Shopify Partner
24 0 13

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?

 

DDDigitalMS_0-1645087532903.png

DDDigitalMS_1-1645087554519.png

DDDigitalMS_2-1645087573158.png

 

DD Digital Marketing Services - UK
Shopify Website Build and Management | SEO | Marketing
LitExtension
Shopify Partner
4860 1002 1160

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 - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
DDDigitalMS
Shopify Partner
24 0 13

@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! 

DD Digital Marketing Services - UK
Shopify Website Build and Management | SEO | Marketing
witherspoony
Tourist
5 0 5

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!

simash
Shopify Partner
7 0 2

This worked. Thank you!

zachmessing
Tourist
3 0 0

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.

Marb2023
Tourist
7 0 2

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"

 

https://afc0f3-3.myshopify.com/?_ab=0&_fd=0&_sc=1

BD-E
New Member
8 0 0

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.

DDDigitalMS
Shopify Partner
24 0 13

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

DD Digital Marketing Services - UK
Shopify Website Build and Management | SEO | Marketing
BD-E
New Member
8 0 0

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

LidaRudiuk
Visitor
1 0 0

Hi! Could you pls tell if you find the way how to display "call for rice" on product page of specific collection?

BD-E
New Member
8 0 0

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.