Make a selection

Installation Guide for Bold Memberships

Laurel
Laurel
  • Updated

Bold Memberships requires our Liquid code installation to function correctly on your store.

We offer a few different options to help you complete this installation on your store:

  1. The ability to request a professional installation from our team
  2. A step-by-step guide on completing this manually

Before you start, it's best practice to create a duplicate version of your Shopify theme to ensure you have a copy without our code installation.

 


 

Request a Bold Memberships install

Note: To maintain the security of your Shopify account, we ask that you do not proactively send us a staff account invite for access to your shop. A Collaborator account is sent from our team to complete the installation instead.

  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!

    Install it for me button

  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.

    Pro-Tip: You can include the theme ID in the text field to specify the exact theme for the installation request. The theme ID can be located from your Shopify admin under Online Store > Themes > Actions icon (beside the theme you would like the installation completed on) > Edit code. Once this page loads, the theme ID is the string of numbers at the end of your browser URL.

    Theme and comments area

  5. Select Looks Good! Send Away!

Completing these steps notifies our team that you wish to have an expert install completed. Our team creates a duplicate copy of the theme to work on to ensure your live store is not disrupted.

Once the installation has been completed in full, our team notifies you by email.

 


 

Manual install

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

 

Step 1: Add Snippet Files

  1. From the Shopify admin, select Online Store.

  2. Select ....

  3. Duplicate the theme you would like the installation completed on.

  4. Select Edit code on the duplicated theme.

  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:

      • {% comment %}This snippet is generated and updated by Bold Memberships.{% endcomment %}
        {% assign bold_hide_item = false %}
        {% assign bold_item_type = 'product'%}
        {% for bold_rule in product.metafields.bold_mem_addtocart %}
        	{% if bold_rule.last== 'hide' %}
        		{% assign bold_hide_item = false %}
        	{% endif %}
        	{% if bold_rule.last == 'show' %}
        		{% assign bold_hide_item = true %}
        		{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: bold_rule.first %}
        	{% endif %}
        {% endfor %}
        {% for bold_rule in product.metafields.bold_mem_addtocart %}
        	{% for customer_tag in customer.tags %}
        	  {% if customer_tag == bold_rule.first %}
        		{% if bold_rule.last == 'hide' %}
        			{% assign bold_hide_item = true %}
        			{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: customer_tag %}
        		{% endif %}
        		{% if bold_rule.last == 'show' %}
        			{% assign bold_hide_item = false %}
        		{% endif %}
        	  {% endif %}
        	{% endfor %}
        {% endfor %}
        
      • {% comment %}This snippet is generated and updated by Bold Memberships.{% endcomment %}
        {% assign bold_hide_item = false %}
        {% assign bold_item_type = 'article'%}
        {% for bold_rule in blog.metafields.bold_mem %}
        	{% if bold_rule.last== 'hide' %}
        		{% assign bold_hide_item = false %}
        	{% endif %}
        	{% if bold_rule.last == 'show' %}
        		{% assign bold_hide_item = true %}
        		{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: bold_rule.first %}
        	{% endif %}
        {% endfor %}
        {% for bold_rule in article.metafields.bold_mem %}
        	{% if bold_rule.last== 'hide' %}
        		{% assign bold_hide_item = false %}
        	{% endif %}
        	{% if bold_rule.last == 'show' %}
        		{% assign bold_hide_item = true %}
        		{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: bold_rule.first %}
        	{% endif %}
        {% endfor %}
        {% for bold_rule in blog.metafields.bold_mem %}
        	{% for customer_tag in customer.tags %}
        	  {% if customer_tag == bold_rule.first %}
        		{% if bold_rule.last == 'hide' %}
        			{% assign bold_hide_item = true %}
        		{% endif %}
        		{% if bold_rule.last == 'show' %}
        			{% assign bold_hide_item = false %}
        		{% endif %}
        	  {% endif %}
        	{% endfor %}
        {% endfor %}
        {% for bold_rule in article.metafields.bold_mem %}
        	{% for customer_tag in customer.tags %}
        	  {% if customer_tag == bold_rule.first %}
        		{% if bold_rule.last == 'hide' %}
        			{% assign bold_hide_item = true %}
        			{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: customer_tag %}
        		{% endif %}
        		{% if bold_rule.last == 'show' %}
        			{% assign bold_hide_item = false %}
        		{% endif %}
        	  {% endif %}
        	{% endfor %}
        {% endfor %}
        
      • {% comment %}This snippet is generated and updated by Bold Memberships.{% endcomment %}
        {% assign bold_hide_item = false %}
        {% assign bold_item_type = 'blog'%}
        {% for bold_rule in blog.metafields.bold_mem %}
        	{% if bold_rule.last== 'hide' %}
        		{% assign bold_hide_item = false %}
        	{% endif %}
        	{% if bold_rule.last == 'show' %}
        		{% assign bold_hide_item = true %}
        		{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: bold_rule.first %}
        	{% endif %}
        {% endfor %}
        {% for bold_rule in blog.metafields.bold_mem %}
        	{% for customer_tag in customer.tags %}
        	  {% if customer_tag == bold_rule.first %}
        		{% if bold_rule.last == 'hide' %}
        			{% assign bold_hide_item = true %}
        			{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: customer_tag %}
        		{% endif %}
        		{% if bold_rule.last == 'show' %}
        			{% assign bold_hide_item = false %}
        		{% endif %}
        	  {% endif %}
        	{% endfor %}
        {% endfor %}
      • {% comment %}This snippet is generated and updated by Bold Memberships.{% endcomment %}
        {% assign bold_hide_item = false %}
        {% assign bold_item_type = 'collection'%}
        {% for bold_rule in collection.metafields.bold_mem %}
        	{% if bold_rule.last== 'hide' %}
        		{% assign bold_hide_item = false %}
        	{% endif %}
        	{% if bold_rule.last == 'show' %}
        		{% assign bold_hide_item = true %}
        		{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: bold_rule.first %}
        	{% endif %}
        {% endfor %}
        {% for bold_rule in collection.metafields.bold_mem %}
        	{% for customer_tag in customer.tags %}
        	  {% if customer_tag == bold_rule.first %}
        		{% if bold_rule.last == 'hide' %}
        			{% assign bold_hide_item = true %}
        			{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: customer_tag %}
        		{% endif %}
        		{% if bold_rule.last == 'show' %}
        			{% assign bold_hide_item = false %}
        		{% endif %}
        	  {% endif %}
        	{% endfor %}
        {% endfor %}
      • {% comment %}This snippet is generated and updated by Bold Memberships.{% endcomment %}
        {% assign bold_hide_item = false %}
        {% assign bold_item_type = 'page'%}
        {% for bold_rule in page.metafields.bold_mem %}
        	{% if bold_rule.last== 'hide' %}
        		{% assign bold_hide_item = false %}
        	{% endif %}
        	{% if bold_rule.last == 'show' %}
        		{% assign bold_hide_item = true %}
        		{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: bold_rule.first %}
        	{% endif %}
        {% endfor %}
        {% for bold_rule in page.metafields.bold_mem %}
        	{% for customer_tag in customer.tags %}
        	  {% if customer_tag == bold_rule.first %}
        		{% if bold_rule.last == 'hide' %}
        			{% assign bold_hide_item = true %}
        			{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: customer_tag %}
        		{% endif %}
        		{% if bold_rule.last == 'show' %}
        			{% assign bold_hide_item = false %}
        		{% endif %}
        	  {% endif %}
        	{% endfor %}
        {% endfor %}
      • {% comment %}This snippet is generated and updated by Bold Memberships.{% endcomment %}
        {% assign bold_hide_item = false %}
        {% assign bold_item_type = 'product'%}
        {% for bold_rule in product.metafields.bold_mem_price %}
        	{% if bold_rule.last== 'hide' %}
        		{% assign bold_hide_item = false %}
        	{% endif %}
        	{% if bold_rule.last == 'show' %}
        		{% assign bold_hide_item = true %}
        		{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: bold_rule.first %}
        	{% endif %}
        {% endfor %}
        {% for bold_rule in product.metafields.bold_mem_price %}
        	{% for customer_tag in customer.tags %}
        	  {% if customer_tag == bold_rule.first %}
        		{% if bold_rule.last == 'hide' %}
        			{% assign bold_hide_item = true %}
        			{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: customer_tag %}
        		{% endif %}
        		{% if bold_rule.last == 'show' %}
        			{% assign bold_hide_item = false %}
        		{% endif %}
        	  {% endif %}
        	{% endfor %}
        {% endfor %}
      • {% comment %}This snippet is generated and updated by Bold Memberships.{% endcomment %}
        {% assign bold_hide_item = false %}
        {% assign bold_item_type = 'product'%}
        {% for collection in product.collections %}
                            {% for bold_rule in collection.metafields.bold_mem %}
                                {% if bold_rule.last == 'hide' %}
                                    {% assign bold_hide_item = false %}
                                {% endif %}
                                {% if bold_rule.last == 'show' %}
                                    {% assign bold_hide_item = true %}
                                    {% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: bold_rule.first %}
                                {% endif %}
                            {% endfor %}
                        {% endfor %}
        {% for bold_rule in product.metafields.bold_mem %}
        	{% if bold_rule.last== 'hide' %}
        		{% assign bold_hide_item = false %}
        	{% endif %}
        	{% if bold_rule.last == 'show' %}
        		{% assign bold_hide_item = true %}
        		{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: bold_rule.first %}
        	{% endif %}
        {% endfor %}
        {% for collection in product.collections %}
                            {% for bold_rule in collection.metafields.bold_mem %}
                                {% for customer_tag in customer.tags %}
                                  {% if customer_tag == bold_rule.first %}
                                    {% if bold_rule.last == 'hide' %}
                                        {% assign bold_hide_item = true %}
                                        {% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: customer_tag %}
                                    {% endif %}
                                    {% if bold_rule.last == 'show' %}
                                        {% assign bold_hide_item = false %}
                                    {% endif %}
                                  {% endif %}
                                {% endfor %}
                            {% endfor %}
                        {% endfor %}
        {% for bold_rule in product.metafields.bold_mem %}
        	{% for customer_tag in customer.tags %}
        	  {% if customer_tag == bold_rule.first %}
        		{% if bold_rule.last == 'hide' %}
        			{% assign bold_hide_item = true %}
        			{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: customer_tag %}
        		{% endif %}
        		{% if bold_rule.last == 'show' %}
        			{% assign bold_hide_item = false %}
        		{% endif %}
        	  {% endif %}
        	{% endfor %}
        {% endfor %}
      • {% if bold_mem_helper == 'product' %}
        	{%include 'bold-memberships-template' %}
        	{% if bold_membership_partial_redirect != true and bold_membership_full_redirect != true %}
          		{%include 'bold-memberships-product' %}
        		{% if bold_hide_item == true %}
        			{%include bold_noaccess_snippet %}
        			{% break %}
        	{% endif %}
        	{% else %}
        		{% break %}
        	{% endif %}
        {%endif%}
        
        {% if bold_mem_helper == 'collection' %}
        	{%include 'bold-memberships-template' %}
        	{% if bold_membership_partial_redirect != true and bold_membership_full_redirect != true %}
          		{%include 'bold-memberships-collection' %}
        		{% if bold_hide_item == true %}
        			{%include bold_noaccess_snippet %}
        			{% break %}
        	{% endif %}
        	{% else %}
        		{% break %}
        	{% endif %}
        {%endif%}
        
        {% if bold_mem_helper == 'page' %}
        	{%include 'bold-memberships-template' %}
        	{% if bold_membership_partial_redirect != true and bold_membership_full_redirect != true %}
          		{%include 'bold-memberships-page' %}
        		{% if bold_hide_item == true %}
        			{%include bold_noaccess_snippet %}
        			{% break %}
        	{% endif %}
        	{% else %}
        		{% break %}
        	{% endif %}
        {%endif%}
        
        {% if bold_mem_helper == 'article' %}
        	{%include 'bold-memberships-template' %}
        	{% if bold_membership_partial_redirect != true and bold_membership_full_redirect != true %}
          		{%include 'bold-memberships-article' %}
        		{% if bold_hide_item == true %}
        			{%include bold_noaccess_snippet %}
        			{% break %}
        	{% endif %}
        	{% else %}
        		{% break %}
        	{% endif %}
        {%endif%}
        
        {% if bold_mem_helper == 'index' %}
        	{%include 'bold-memberships-template' %}
        	{% if bold_membership_partial_redirect != true and bold_membership_full_redirect != true %}
          		{%include 'bold-memberships-index' %}
        		{% if bold_hide_item == true %}
        			{%include bold_noaccess_snippet %}
        			{% break %}
        	{% endif %}
        	{% else %}
        		{% break %}
        	{% endif %}
        {%endif%}
        
        {% if bold_mem_helper == 'blog' %}
        	{%include 'bold-memberships-template' %}
        	{% if bold_membership_partial_redirect != true and bold_membership_full_redirect != true %}
          		{%include 'bold-memberships-blog' %}
        		{% if bold_hide_item == true %}
        			{%include bold_noaccess_snippet %}
        			{% break %}
        	{% endif %}
        	{% else %}
        		{% break %}
        	{% endif %}
        {%endif%}
        
        {% if bold_mem_helper == 'search' %}
        	{% assign product = item %}
        	{%include 'bold-memberships-product' %}
        	{% if bold_hide_item == true %}
        		{% continue %}
        	{% endif %}
        {%endif%}
        
        {% if bold_mem_helper == 'template_only' %}
        	{%include 'bold-memberships-template' %}
        {%endif%}
      • {%comment %}This snippet is generated and updated by Bold Memberships. any changes will be overridden when the Store Owner saves a Plan in the app.{%endcomment%}
        
        {% assign bold_membership_partial_redirect = false %}
        
        {% assign bold_membership_full_redirect = false %}
        
        {% assign mem_current_template = template %}
        
        {%if bold_membership_partial_redirect == true %}
        	<script>
        	 top.location = (window.location.href + "?view={{bold_membership_template}}");
        	</script>
        {%endif%}
        
        {% if bold_membership_full_redirect == true %}
            <script>
             bold_url = window.location.href
             top.location = bold_url.split("?view=")[0];
            </script>
        {%endif%}
      • {% comment %}This snippet is generated and updated by Bold Memberships.{% endcomment %}
        {% assign bold_hide_item = false %}
        {% assign bold_item_type = 'index'%}
        {% for bold_rule in index.metafields.bold_mem %}
        	{% if bold_rule.last== 'hide' %}
        		{% assign bold_hide_item = false %}
        	{% endif %}
        	{% if bold_rule.last == 'show' %}
        		{% assign bold_hide_item = true %}
        		{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: bold_rule.first %}
        	{% endif %}
        {% endfor %}
        {% for bold_rule in index.metafields.bold_mem %}
        	{% for customer_tag in customer.tags %}
        	  {% if customer_tag == bold_rule.first %}
        		{% if bold_rule.last == 'hide' %}
        			{% assign bold_hide_item = true %}
        			{% assign bold_noaccess_snippet = 'bold-memberships-noaccess-' | append: customer_tag %}
        		{% endif %}
        		{% if bold_rule.last == 'show' %}
        			{% assign bold_hide_item = false %}
        		{% endif %}
        	  {% endif %}
        	{% endfor %}
        {% endfor %}
    5. Select Save.

 

Step 2: Edit theme.liquid

  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.

 

Step 3: Edit article.liquid

  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 Bold Memberships, 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.

 

Step 4: Edit blog.liquid

  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 Bold Memberships, 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.

 

Step 5: Edit page.liquid

  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 Bold Memberships, 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 Example

  3. Select Save.

 

Step 6: Edit search.liquid

  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.

 

Step 7: Edit customers/account.liquid

  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.

 

Step 8: Edit collection.liquid

  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 Bold Memberships, 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 the collection-template.liquid file under Sections, or within the product-loop.liquid file under Snippets.

    • Some themes will use a slight variation of this code. If you can't find it, try looking for the following instead:
      
          {% for prod in collection.products %}
          {% for product in collections.all.products %}
          {% for product in products limit: limit %}
          {% for product in product-list.products limit: for_limit %}
          {% for product in collection.products limit: settings.pagination_limit %}
          {% for product in collection.products limit: number_of_products_to_fetch %}
          {% for product in collection.products limit: number_of_related_products %}
          {% for product in collections[settings.frontpage_collection].products offset:1 %}
          {% for product in collection.products limit: settings.products-per-page %}
      
      Some themes will have this code in a file that is included into the collection.liquid file. Look to see if the theme has a product-loop.liquid or product-list.liquid in the Snippets folder, and see if the code is in there.
      

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

 

Step 9: Edit product.liquid

  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 Bold Memberships, 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 paste 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.

 

Step 10: Edit index.liquid

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

    Paste the Code

  3. Select Save.

 

Once the liquid code install has been completed, you 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 further steps on connecting a Stripe account to Bold Memberships.

 


 

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, asset files, and the code includes mentioned in the instruction steps above.

You can otherwise request a code removal by contacting our Customer Success team.

You can remove the app from your Shopify admin by following this guide: Uninstall Bold Memberships from Your Store.

Note: If you are experiencing issues with performance on the storefront with Bold Memberships after completing the steps above, we recommend requesting an expert installation, as your theme may require further liquid code changes. See previous section Request a Bold Memberships Install for more information.