Bold Discounts Duplicate & Hide Install Instructions

Follow

Warning!

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 Store.

    Select Online Store

  2. Select Actions.

    Select Actions

  3. Select Edit code.

    Select Edit Code

  4. 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

  5. Find each instance of this code:

    {% for item in search.results %}

    Find for item search

  6. Add this code below each instance:

    {% if item.metafields.inventory.ShappifyHidden %}{% continue %}{% endif %}

    Paste for item search code

  7. Select Save.

    select save

  1. From Shopify's admin, select Online Store.

    Select Online Store

  2. Select Actions.

    Select Actions

  3. Select Edit code.

    Select Edit Code

  4. Under "Templates", select collection.liquid.

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

    Select collection.liquid

  5. Find each instance of this code:

    {% for product in collection.products %}

    Can't find this code?

    Find for product collections

  6. Add this code below each instance:

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

    Paste for product collection code

  7. Select Save.

    select save

  8. Repeat Step 2.5 - 2.7 if this code exists within the index.liquid and related-products.liquid files.
  1. From Shopify's admin, select Online Store.

    Select Online Store

  2. Select Actions.

    Select Actions

  3. Select Edit code.

    Select Edit Code

  4. Under "Templates", select product.liquid.

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

    Select product.liquid

  5. Add this code to the top of the file:

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

    Paste product code

  6. Select Save.

    Select save

  1. From Shopify's admin, select Online Store.

    Select Online Store

  2. Select Actions.

    Select Actions

  3. Select Edit code.

    Select Edit Code

  4. Under "Layout", select theme.liquid.

    Select theme.liquid

  5. Find the </head> tag.

    Find head tag

  6. Add this code above it:

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

    Paste head code

  7. Select Save.

    select save

  1. From Shopify's admin, select Online Store.

    Select Online Store

  2. Select Actions.

    Select Actions

  3. Select Edit code.

    Select Edit Code

  4. Under "Templates", select cart.liquid.

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

    Select cart.liquid

  5. 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

  6. 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 product.metafields.inventory.ShappifyHidden %} readonly {% endif %} />

    Paste input code

  7. Select Save.

    select save

That's it!

Next Steps:

10 out of 10 found this helpful

Comments

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

    0
    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.

    - https://support.boldcommerce.com/hc/en-us/articles/200464493-Create-a-Buy-One-Get-One-BOGO-Offer

    Feel free to drop us a line at support@boldcommerce.com if you have any further questions from here!

    Cheers,
    Brendin
    Knowledge Centre Manager

    0
    Comment actions Permalink

Please sign in to leave a comment.