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 function; 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. Duplicate themes, to create a backup copy.
  2. From Shopify's admin, select Online Store.

    Select_Online_Store.png

  3. Select Actions.

    Actions

  4. Select Edit code.

    Edit code

  5. Under "Snippets", find these three files:
    • bold-product.liquid
    • bold-variant.liquid
    • bold-cart-item.liquid

    Find_Three_Snippets.png

  6. For any that don't exist:
    1. Select Add a new snippet.

      Select_Add_New_Snippet.png

    2. Enter the correct Snippet name.

      Enter_Snippet_Name.png

    3. Select Create snippet.

      Select_Create_Snippet.png

    4. Copy and paste the code found in each of these links into their respective files:

      Paste_Snippet_Code.png

    5. Select Save.

      Select_Save.png

    6. Repeat steps 6a – d for each missing snippet file.
  1. From Shopify's admin, select Online Store.

    Select_Online_Store.png

  2. Select Actions.

    Actions

  3. Select Edit code.

    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 each instance of this code

  6. Add this code below each instance:

    {% include 'bold-product' with item, hide_action: 'skip' %}

    add this code below each instance

  7. Select Save.

    select save

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

    Select_Online_Store.png

  2. Select Actions.

    Actions

  3. Select Edit code.

    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 the code

  6. Add this code below each instance:

    {% include 'bold-product' with product, hide_action: 'skip' %}

    add this code below each instance

  7. Select Save.

    select save

  8. Complete these steps in index.liquid and related-products.liquid if the code exists within them. If it doesn't exist, continue with Step 4.
  1. From Shopify's admin, select Online Store.

    Select_Online_Store.png

  2. Select Actions.

    Actions

  3. Select Edit code.

    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:

    {%- include 'bold-product' with product, hide_action: 'break', output: 'none' -%}

    add this code to the top

  6. Select Save.

    Select save

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

    select theme.liquid

  8. Find the </head> tag.

    find the head tag

  9. Add this code above it:

    {%- include 'bold-product' with product, hide_action: 'header' -%}

    copy and paste this code

  10. Select Save.

    select save

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

    Select_Online_Store.png

  2. Select Actions.

    Actions

  3. Select Edit code.

    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. Find each instance of this code:

    {% for item in cart.items %}

    find each instance of the code

  6. Add this code below each instance:

    {% include 'bold-cart-item' with item %}

    add this code below each instance

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

    look for a line like this

  8. Right before the /> add this code:

    {{ bold_qty_attr }}

    The result should look something like this:

    <input value="{{ item.quantity }}" {{ bold_qty_attr }} />

    add {{ bold_qty_attr }}

  9. Select Save.

    select save

That's it!

Next Steps:

Blog Posts:

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.