Top

Duplicate & Hide Install Instructions

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

  1. Duplicate themes, to create a backup copy.
  2. From "Shopify Admin", select Online Store.

    select online store 

  3. Select Actions.

    Select Actions 

  4. Select Edit code.

    Select 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 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 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 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 %}

    Step28.png 

  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 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:
    {% include 'bold-product' with product, hide_action: 'skip' %}

    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 this line:
    {% if product.metafields.inventory.ShappifyHidden == "true" %} {% endif %}

    add this code above the line 

  10. Select Save.

    select save 

  1. From "Shopify 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. 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 }}"

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

  9. Select Save.

    select save 

That's it!