Need help hiding product prices on collection pages (for digital products only)

Hi everyone,

I’m looking for help with a small code edit. I want to hide product prices on collection pages, but only for certain product types—like digital or affiliate products.

I’m using a Shopify 2.0 theme with JSON templates, and I’ve tagged these products “affiliate.” I think it just needs a conditional {% if %} Liquid snippet.

Would anyone be willing to point me to the code or show me how to adjust the product card section?

Thanks in advance!

1 Like

Hi @gregorieg ,

Could you please share your Store URL and password (if applicable) so that I can review it and provide you with the appropriate solution code?

Looking forward to your response.

Thanks!

Hi @gregorieg ,

Please go to ‘…’ > Edit code > snippets > card-product.liquid file. Please send me all code, I will check and guide you

Hi @gregorieg

Please go to your store admin > Sales Channels > Online Store > Themes > click “…” in the current theme > Edit code > open card-product.liquid and find the following line of code.

{% render 'price', product: card_product, price_class: '', show_compare_at_price: true %}

Replace it with this code and save file

{% unless card_product.tags contains 'affiliate' %}
{% render 'price', product: card_product, price_class: '', show_compare_at_price: true %}
{% endunless %}

Thanks for your response! I tried a few different code adjustments (including this one), but the issue still persisted. I’ve decided to keep the price visible and populate it with the vendor’s retail price instead.

Thank you for offering to help! After working through a few options, I’ve decided to keep the prices visible and populate them with the retailer’s listed price instead.

1 Like

Thanks for offering to help! I’ve decided to leave the prices visible and match them to the retailer’s pricing. Appreciate your time!