Bold Motivator Premium Code Install Instructions

 Caution

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

Overview

Before you begin, review Notes Before Installing Apps. This article can help get you prepared and answers many common questions.

This coding installation is only required if you're offering free gift items with Motivator Premium.

 Caution

If you would like to remove the liquid code from your theme, the liquid code can be removed by deleting the lines of code mentioned in the instruction steps below. You can also request an uninstall request by contacting our Merchant Success team.

Note: If you are experiencing issues with performance on the storefront with Bold Motivator after completing the steps below, we recommend requesting an expert installation, as your theme may require further liquid code changes.

Select each step below to view the instructions.

Note: Within the theme files, complete the following steps.

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

    Select theme.liquid

  2. Copy and paste this code directly above the </head> tag:
    {% if product.metafields.inventory.ShappifyHidden == "true" %} <meta name="robots" content="noindex"> {% endif %}

    copy and paste this code

  3. Select Save.

Note: Within the theme files, complete the following steps.

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

    Note: If your template contains sections, you will need to select the collection-template.liquid section instead.

    Select collection.liquid

  2. Find:

    {% for product in collection.products %}

    Note: This line may appear more than once in the file, you will need to add the line of code for each instance. Can't find this code?

    Find for product loop

  3. Copy and paste this code directly below each instance:

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

     

  4. Select Save.

Note: Within the theme files, complete the following steps.

  1. Under "Templates", select index.liquid.

    Select index.liquid

  2. Find:

    {% for product in collection.products %}

    Note: This line may appear more than once in the file, you will need to add the line of code for each instance. Can't find this code?

    Find index code

  3. Copy and paste this code directly below each instance:

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

    Paste index code

  4. Select Save.

     

Note: Within the theme files, complete the following steps.

  1. Under "Snippets", select related-product.liquid.

    Note: If the theme does not have the file related-product.liquid, proceed to the next step.

    Select related-products.liquid

  2. Find:

    {% for product in collection.products %}

    Note: This line may appear more than once in the file, you will need to add the line of code for each instance. Can't find this code?

    Find related products code

  3. Copy and paste this code directly below each instance:

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

    Paste related products code

  4. Select Save.

Note: Within the theme files, complete the following steps.

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

    Note: You may find this code in a similarly titled file instead.

    Select search.liquid

  2. Find:

    {% for item in search.results %}

    Note: This line may appear more than once in the file, you will need to add the line of code for each instance.

    Find search code

  3. Copy and paste this code directly below each instance:

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

    Paste search code

  4. Select Save.

Note: Within the theme files, complete the following steps.

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

    Note: If your template contains sections, you will need to select the product-template.liquid section instead.

    Select product.liquid

  2. Paste this code at the top of the file:
    {% if product.metafields.inventory.ShappifyHidden %}{% break %}{% endif %}

    Paste product code

  3. Select Save.

Note: Within the theme files, complete the following steps.

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

    Note: If your theme contains sections, you may have to look for this code under "Sections" in cart-template.liquid instead.

    Select cart.liquid

  2. Find a line that starts with <input,ends with /> and contains value="{{ item.quantity }}". Can't find this code?

    Find the code

  3. Copy and paste:

    {% if item.product.metafields.inventory.ShappifyHidden == 'true'%} readonly {% endif %}

    right before the />.

    It will look similar to this:

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

    Paste cart code

  4. Select Save.

     

Was this article helpful?
7 out of 12 found this helpful