Bold Discounts Duplicate & Hide Install Instructions



This article requires technical knowledge and prior experience with liquid code. If you are not comfortable with this, please Request a Bold Discounts Installation for help.

The duplicate and hide install instructions are required if you are using Bold Discounts with Bold Upsell. These steps are necessary to ensure the discounted products that are only available in an upsell offer are not visible on your storefront. This allows you to use Discounts with Upsell to offer Buy One Get One deals on your site.

Note: Discounts does not require any Liquid code to place your products on sale; it works right out of the box. Discounts also has optional coding installations if you wish to display sales icons or a sales clock on your discounted products.

To install the duplicate and hide code to your theme for Discounts, please follow these steps:

  1. From Shopify's admin, select Online StoreActions, then Edit code.
  2. Under "Templates", select search.liquid.

    Note: If your theme contains sections, you may find this code within search-template.liquid under "Sections" instead.

    Select search.liquid

  3. Find each instance of this code:
    {% for item in search.results %}

    Find for item search

  4. Add this code below each instance:
    {% if item.metafields.inventory.ShappifyHidden %}{% continue %}{% endif %}

    Paste for item search code

  5. Select Save.
  1. From within your theme editor, select collection.liquid under "Templates".

    Note: If your theme contains section you may find this code within collection-template.liquid under "Sections" instead.

    Select collection.liquid

  2. Find each instance of this code:
    {% for product in collection.products %}

    Can't find this code?

    Find for product collections

  3. Add the following code below each instance:
    {% if product.metafields.inventory.ShappifyHidden %}{% continue %}{% endif %}

    Paste for product collection code

  4. Select Save.
  5. Repeat Step 2.2 - 2.4 if this code exists within the index.liquid and related-products.liquid files.
  1. From within your theme editor, select product.liquid under "Templates".

    Note: If your theme contains section you may find this code within product-template.liquid under "Sections" instead.

    Select product.liquid

  2. Add the following code to the top of the file:
    {% if product.metafields.inventory.ShappifyHidden %}{% break %}{% endif %}

    Paste product code

  3. Select Save.
  1. From within the theme editor, select theme.liquid under "Layout".

    Select theme.liquid

  2. Find the </head> tag.

    Find head tag

  3. Add this code above it:

    {% if product.metafields.inventory.ShappifyHidden == "true" %} <meta name="robots" content="noindex"> {% endif %}

    Paste head code

  4. Select Save.
  1. From within the theme editor, select cart.liquid under "Templates".

    Note: If your theme contains section you may find this code within cart-template.liquid under "Sections" instead.

    Select cart.liquid

  2. Look for a line that starts with "<input containing value="{{ item.quantity }}"

    Note: Visit Can't find this code? for more information on the different ways this may display in your theme.

    Find input code

  3. Right before the /> add this code:

    {% if product.metafields.inventory.ShappifyHidden %} readonly {% endif %}

    The result should look something like this:

    <input value="{{ item.quantity }}"{% if item.product.metafields.inventory.ShappifyHidden == "true" %} readonly="readonly" {% endif %} />

    Make the necessary change

  4. Select Save.
11 out of 11 found this helpful


  • will this literally duplicate the items or just add variants for the pricing groups?

    Comment actions Permalink
  • Hey Anthony!

    Sorry for the delay in response here - our duplicate & hide coding with Bold Discounts works to create a complete copy of the product(s) that you specify within the app, and then hide it/them from the storefront.

    We pair this functionality with our Bold Upsell app to give you the ability to offer BOGO deals to your customers without having to create coupon codes in Shopify or expose fully discounted products on your store.


    Feel free to drop us a line at if you have any further questions from here!

    Knowledge Centre Manager

    Comment actions Permalink

Please sign in to leave a comment.