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

  3. Select Actions.

    Actions

  4. Select Edit code.

    Edit code

  5. Under "Snippets", look for bold-product.liquid.

    look for bold-product.liquid

  6. If it doesn't exist, select Add a new snippet.

    add a new snippet

  7. Enter bold-product.liquid in the "Create a new snippet called" field.

    enter bold-product.liquid

  8. Select Create snippet.

    select create snippet

  9. Copy and paste the bold-product.liquid code into the file.

    copy and paste the code

  10. Select Save.

    select save

  11. Under "Snippets", look for bold-variant.liquid.

    look for bold-variant.liquid

  12. If it doesn't exist, select Add a new snippet.

    add a new snippet

  13. Enter bold-variant.liquid in the "Create a new snippet called" field.

    create a new snippet

  14. Select Create snippet.

    create snippet

  15. Copy and paste the bold-variant.liquid code into the file.

    copy and paste the code

  16. Select Save.

    select save

  17. Under "Snippets", look for bold-cart-item.liquid.

    look for bold-cart-item.liquid

  18. If it doesn't exist, select Add a new snippet.

    add a new snippet

  19. Enter bold-cart-item.liquid in the "Create a new snippet called" field.

    enter bold-cart-item.liquid

  20. Select Create snippet.

    select create snippet

  21. Copy and paste the bold-cart-item.liquid code into the file.

    copy and paste the code

  22. Select Save.

    select save

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

    select online store

  2. Select Actions.

    Actions

  3. Select Edit code.

    Edit code

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

    Note: If your theme contains section 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

  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

  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

  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 }}" Can't find this code?

    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?

  • 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

Please sign in to leave a comment.