Shopify Product Reviews- hide on certain product pages

Kriz
Shopify Staff
Shopify Staff
37 0 10

Hi everyone!

I have installed the product reviews app, and it's great. I love the way it appears on my site and it's really easy to use. However, it's a little redundant to have a product review on my Gift Card page.

How can I remove the reviews from the gift card page? I've been searching my HTML/CSS and can't come up with anything.

Your help is greatly appreciated!

0 Likes
Jason
Shopify Expert
10039 119 1876

Hey Andrew,

You'd be able to wrap the existing review code in a conditional statement so that it doesn't show on Gift Cards. I'm not 100% sure of the code you've got in place so this example will just be a rough guide:

{% unless product.type == "Gift Card" %}
  <!-- the embed code for the review app would go in here -->
{% endunless %}

^ So wrap the existing code in an unless statement. This usage will ensure any product with the type of "Gift Card" will not have the review code added.

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
Katy_old
Shopify Staff
Shopify Staff
391 1 43

Hey Andrew!

Koreen from the Shopify Guru team here, thanks for reaching out :)

Glad that you like the product reviews app! It's a great way for your customers to give feedback on your products and in turn encourage more sales. I understand though that gift cards wouldn't always require this feature, good point!

To remove these reviews from your gift cards, what you can do is create an alternate product template for this product within your theme's HTML. We have a great guide on how to do this which I have included here:

https://docs.shopify.com/themes/customization/store/create-alternate-templates

Once you have created this alternate template, you can then remove the code for the product reviews app, or comment this out so it doesn't pull through.

There is a handy post on how to comment out in Liquid here:

https://ecommerce.shopify.com/c/shopify-discussion/t/commenting-out-in-liquid-31287

Once you have done this, you can then click into your Admin>products and assign the alternate template from the drop down to your gift cards instead.

I hope this helps!

Cheers,

Koreen :)

 

0 Likes
Caroline28
New Member
3 0 0

Hi Koreen, How does this work if the review code was pasted into the snippets part, not into a section. (I followed the Product Review app instructions to paste the code into a snippet). But if the code does not exist in sections part, how can it be removed?   Thanks 

0 Likes
sarahjg50
New Member
2 0 0

Hi, has this changed since 2016? I've been trying to do this on my website and can't get it to work. Thanks

0 Likes