Hiding Upsell Products on Your Online Store

Follow

Since up-sell products act as any other regular product from your store, it will be treated as such without adding conditions into your templates. If you would like to hide these products on your store, you could set the product type of these product to be 'HIDDEN'.

To hide these products, you can check for items with a product type of 'HIDDEN' in your collection product loop, then skip to the next product without displaying the hidden one using this code snippet:

{% if product.type == 'HIDDEN' %}

{% continue %}

{% endif %} 

Similar logic would have to be applied throughout your theme wherever you need to ensure the product is not displayed.

If you want to hide this collection from your collection page, the same logic applies to your collections.liquid file:

{% if collection.handle == 'upsell-collection' %}

{% continue %}

{% endif %} 
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.