For supply theme open up your product-grid-item.liquid file in your snippets folder and look for this line and add an unless statement around it:
{% unless collection.handle == 'your-collection-handle' %}
<div class="product-item--price">
<span class="h1 medium--left">
{% if on_sale %}
<span class="visually-hidden">{{ "products.general.sale_price" | t }}</span>
{% else %}
<span class="visually-hidden">{{ "products.general.regular_price" | t }}</span>
{% endif %}
{% include 'price' with product.price %}
{% if on_sale and section.settings.product_show_compare_at_price %}
<small>
<s>
<span class="visually-hidden">{{ "products.general.regular_price" | t }}</span>
{% include 'price' with product.compare_at_price %}
</s>
</small>
{% endif %}
</span>
{%- if product.selected_or_first_available_variant.available and product.selected_or_first_available_variant.unit_price_measurement -%}
{% include 'product-unit-price', variant: product.selected_or_first_available_variant %}
{%- endif -%}
</div>
{% endunless %}
That will make it so your prices don't show on whatever collection you specify in the statement.
Not much else I can say, make sure your collection handle is correct. I did it on my Supply theme and it worked out fine. If you want me to help you out just send me a DM with your store url and the name of the collection you want to hide and I'll request access to your store, duplicate your theme, and make the change for you.
Hi Ninthony,
I added the code to theme.scss.liquid to remove product prices on collection pages and also commented out prices on product pages (created an alternate product template), since I have a single product store and price tiers are listed on the pricing page and Homepage as well. Google Ads suspended my adwords account for Circumventing systems policy, specifically Cloaking - which basically is redirecting users to a different URL and/or showing different content to google bot vs site visitors. I've checked all the URL redirects to make sure everything is in order. I believe it's the hidden product price, that's leading to the cloaking issue.
The only code change I made on product page is to hide (comment out) product prices and added the code above to remove prices from collection pages as well. Would really appreciate your thoughts on, if this could be considered as Cloaking ? - showing different content to the google bot (price is visible in the product page xml code) but is hidden from the users/site visitors.
Would appreciate your thoughts on this. Thanks!
Hey @Ninthony Thank so much for all your help with this issue. I've been testing everything you've suggested and while this last piece of code worked for me in the desired collection, it gave me an error in another collection where I'd like to keep the pricing. Any thoughts on how to have pricing in one collection, but not another? TIA
You just have to make a condition around the price using the collection handle:
{% unless collection.handle == "t-shirts" %}
<div class="product-price">{{ product.price | money }}</div>
{% endunless %}
So in this instance the price would show up on every collection unless it was the T Shirt collection.
Yup, you would have to make sure that the checkbox in the products admin "Track Quantity" is checked and "Continue Selling when Out of Stock" is not checked. Then you can add a condition around the price:
{% if product.available %}
{{ product.price }}
{% endif %}
User | Count |
---|---|
735 | |
141 | |
101 | |
64 | |
41 |