Articles on: General

How to hide products from the online store and only use them as an upsell product

Products must be Active and Published on the Online Store in order for the offers to work:


We understand that there are times wherein you will want certain products to be used only as upsells or free gifts. To do that, we'd need to add some lines of code to the liquid files you'd want the products to be hidden, and here are the steps:


  1. We'd need to tag the product you'll be hiding. We'll use the 'exlude-search' tag
  2. Make sure the product is not included in any collection. Remove products from a manual collection

  1. Locate the liquid files of the places you want to hide the product: If you want to completely hide the product, you'd want to hide it from these sections:


  • main-search.liquid
  • predictive-search.liquid
  • main-cart-items.liquid
  • cart-drawer.liquid


  1. Once you've located the places you want to hide the product from, these are the lines of code you'd need to add:
 {%- if item.object_type == 'product' and item.tags contains 'exclude-search' -%}
{%- continue -%} {# skip this item #}
{%- endif -%}


  • For the main-search.liquid, find "{%- for item in search.results -%}" line of code and paste the code just below it:



  • For the predictive-search.liquid, find "{%- for product in predictive_search.resources.products -%}" line of code and paste the code just below it:



  • For the main-cart-items.liquid, find "{%- for item in cart.items -%}" line of code and paste the code just below it:



  • For the cart-drawer.liquid, find "{%- for item in cart.items -%}" line of code and paste the code just below it:



Note: Your upsold product or free gift will be visible in the checkout page


Updated on: 16/07/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!