Bold Memberships Code Install Instructions

 Caution

This article requires technical knowledge and experience with Liquid code. If you are not comfortable with code, please contact our Merchant Success team.

Request an Installation

To request an Expert Installation from our team, please follow these steps:

  1. From the Bold Memberships admin, select More.

    From the Memberships admin, click More

  2. Select Liquid Instructions.

    Click Liquid Instructions

  3. Under Option 2, select Yes Please. Install it for me!

    Click Install It For Me

  4. Select the theme you would like us to install the app's code on. You can also specify any additional comments in the Do you have any other questions or comments? text field.

    Select Your Theme

  5. Select Looks Good! Send Away!

This will create a ticket request with our installation team.

All Expert Installations are then manually completed on a first-come-first-served basis. You will be asked to confirm which theme you would like this code to be installed onto after selecting this option.

 


 

Complete the Installation Manually

This code installation is required if you want to show or hide certain pages from your customers or show members only content, based on their membership.

Select each step below to view the instructions.

  1. Duplicate your theme to create a backup copy.
  2. From Shopify's admin, select Online Store.
  3. Select Actions.
  4. Select Edit code.
  5. Under "Snippets", find the following files: 
    • bold-memberships-addtocart.liquid
    • bold-memberships-article.liquid
    • bold-memberships-blog.liquid
    • bold-memberships-collection.liquid
    • bold-memberships-page.liquid
    • bold-memberships-price.liquid
    • bold-memberships-product.liquid
    • bold_mem_helper.liquid
    • bold-memberships-template.liquid
    • bold-memberships-index.liquid
  6. If some of the files are missing:
    1. Select Add a new snippet.
    2. Enter the correct snippet name (listed below).
    3. Select Create snippet.
    4. Copy and paste the code found in each of these links into their respective files:
    5. Select Save.

Continuing within the theme files, complete the following steps:

  1. Under "Layout", select theme.liquid.
  2. Copy and paste this code on the line after the <body> tag:
    <!-- Bold: Memberships -->
    {% if customer %}
    <div class="bold_customer_id" hidden>{{ customer.id }}</div>
    {% endif %}
    <!-- end Bold code -->

    copy and paste this code

  3. Select Save.

Continuing within the theme files, complete the following steps:

  1. Under "Templates", select article.liquid.
  2. Copy and paste this code at the beginning of the file:

    Note: If you intend to use the alternate template feature within the Memberships app, each template must have this include at the top.

    <!-- Bold: Memberships (Article) -->
    {% include 'bold_mem_helper' with 'article' %}
    <!-- end Bold code -->

    copy and paste this code

  3. Select Save.

Continuing within the theme files, complete the following steps:

  1. Under "Templates", select blog.liquid.
  2. Copy and paste this code at the beginning of the file:

    Note: If you intend to use the alternate template feature within the Memberships app, each template must have this include at the top.

    <!-- Bold: Memberships (blog) -->
    {% include 'bold_mem_helper' with 'blog' %}
    <!-- end Bold code -->

    copy and paste this code

  3. Select Save.

Continuing within the theme files, complete the following steps:

  1. Under "Templates", select page.liquid.
  2. Copy and paste this code just before the {{ page.content }} section:

    Note: If you intend to use the alternate template feature within the Memberships app, each template must have this include at the top.

    <!-- Bold: Memberships (page) -->
    {% include 'bold_mem_helper' with 'page' %}
    <!-- end Bold code -->

    page.liquid_mem_helper_insert.png

  3. Select Save.

Continuing within the theme files, complete the following steps:

  1. Under "Templates", select search.liquid.
  2. Look for:

    {% for item in search.results %}

    or:

    {% for product in search.results %}

    look for this code

  3. Copy and paste this code below the line:
    <!-- Bold: Memberships (search) -->
    {% include 'bold_mem_helper' with 'search' %}
    <!-- end Bold code -->

    copy and paste this code

  4. Select Save.

Continuing within the theme files, complete the following steps:

  1. Under "Templates", select customers/account.liquid.
  2. Copy and paste this code at the beginning of the file:
    <!-- Bold: Memberships (accounts) -->
    {% include 'bold-memberships-salt' %}
    <!-- end Bold code -->

    copy and paste this code

  3. Look for code similar to this:

    <h1 class="title clearfix">

    look for this line

  4. Copy and paste this code below the line:
    <!-- Bold: Memberships (manage memberships) -->
    <span class="note"><a href="/apps/memberships/accountDetails/?id={{customer.id}}&h={{bold_memberships_hash}}">Manage Memberships</a></span>
    <!-- end Bold code -->

    copy and paste this code

  5. Select Save.

Continuing within the theme files, complete the following steps:

  1. Under "Templates", select collection.liquid.
  2. Copy and paste this code at the beginning of the file:

    Note: If you intend to use the alternate template feature within the Memberships app, each template must have this include at the top. If you are using sections, you may need to do these steps in collection-template.liquid under "Sections" instead.

    <!-- Bold: Memberships (collection) -->
    {% include 'bold_mem_helper' with 'collection' %}
    <!-- end Bold code -->

    copy and paste this code

  3. Look for:

    {% for product in collection.products %}

    Note: This code may be found within "Sections", collection-template.liquid or "Snippets, product-loop.liquid. Can't find this code?

    look for this line

  4. Copy and paste this code below the line:
    <!-- Bold: Memberships (collection products) -->
    {% include 'bold-memberships-product' %}
    {% if bold_hide_item == true %}
    {% continue %}{% endif %}
    <!-- end Bold code -->

    copy and paste this code

  5. Look for code referencing a price like:

    {{ product.price | money }}

    Note: This code may be found in other liquid files as well.

    look for this code

  6. Wrap this code around each price code:
    <!-- Bold: Memberships (collection price) -->
    {% include 'bold-memberships-price' %}
    {% if bold_hide_item == false %}
    
    <!-- price code stuff -->
    
    {% endif %}
    <!-- end Bold code -->

    paste this code

  7. Select Save.

Continuing within the theme files, complete the following steps:

  1. Under "Templates", select product.liquid.
  2. Copy and paste this code at the beginning of the file:

    Note: If you intend to use the alternate template feature within the Memberships app, each template must have this include at the top. If your theme contains sections, make these changes within product-template.liquid under "Sections".

    <!-- Bold: Memberships (product) -->
    {% include 'bold_mem_helper' with 'product' %}
    <!-- end Bold code -->

    copy and past this code

  3. Find the add to cart button.

    Note: Some themes may have an add to cart button outside the product page, such as a quick view window. Add this code there as well.

    find the add to cart button

  4. Wrap the button with this code:
    <!-- Bold: Memberships (cadd to cart) -->
    {% include 'bold-memberships-addtocart' %}
    {% if bold_hide_item == false %}
    
    <!-- Addtocartbutton here -->
    
    {% endif %}
    <!-- end Bold code -->

    paste this code

  5. Look for code referencing a price like:

    {{ product.price | money }}

    Note: This code may be found in other liquid files as well.

    look for this code

  6. Wrap each price code with this code:
    <!-- Bold: Memberships (product price) -->
    {% include 'bold-memberships-price' %}
    {% if bold_hide_item == false %}
    
    <!-- price code stuff -->
    
    {% endif %}
    <!-- end Bold code -->

    paste this code

  7. Select Save.

Continuing within the theme files, complete the following steps:

  1. Under "Templates" select index.liquid.
  2. Copy and paste this code at the beginning of the file.
    <!-- Bold: Memberships (index) -->
    {% include 'bold_mem_helper' with 'index' %}
    <!-- end Bold code -->

    Pasted Code

  3. Select Save.

Note: If you're experiencing storefront performance issues after completing the Bold Memberships installation, we recommend requesting an expert installation, as your theme may require further liquid code changes.

 


 

Code Removal

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

 


 

Next Steps

Once the liquid code install has been completed, you will need to connect your Stripe account to Bold Memberships in order for your customers to purchase a membership on your storefront.

Please visit Connect your Stripe Account to Bold Memberships for steps on connecting a Stripe account to Bold Memberships.

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