Make a selection

Installation Guide for Custom Pricing

Laurel
Laurel
  • Updated

Custom Pricing must be properly installed on your theme in order to run correctly. The installation ensures that your pricing appears on your product pages, and your customer's selections appear correctly in both the cart and checkout page.

Note: This article has installation instructions for all three versions of Custom Pricing. It is recommended to determine which version is installed on your store before proceeding. Please visit Discount Methods and How to Switch.

 


 

Manual install instructions (via app embed)

The manual install via app embed can be performed on both vintage and Online Store 2.0 themes. 

Note: Changing the discount method/version in Custom Pricing requires the app embeds to be re-enabled in your theme's Customize page.

 

V3 install instructions

Step 1: Show the correct pricing on collection and product pages

  1. From your Shopify admin, navigate to Online Store > Themes.
  2. Click on the Customize button next to the theme you would like to install Custom Pricing on.
  3. Click App embeds from the left sidebar.

    Click App embeds

  4. Enable the Bold CSP V3 Price Rule and Bold CSP v3: Prices app embeds for your theme by sliding the toggle to the right.

    Bold CSP V3 embeds

  5. Click the arrow next to Bold CSP V3 Price Rule to expand the settings, and adjust the following settings as needed:
    1. Enable compare at price - Check the box to enable this setting if you'd like to see compare at pricing on your storefront. This displays both the regular price with a strike-through and the discounted price.
    2. Skip PRE JS file load - Check the box to enable this setting if you also have Bundles V3 or Discounts Powered by Bold Price Rules on your store.
  6. Click on the arrow next to Bold CSP v3: Prices to expand the settings, and adjust the following settings as needed:

    Note: By default, these settings contain information relevant to the Dawn theme.

    1. Product Price Locator (Query Selector) - Enter the query selector of the price element from the product page.
    2. Collection Item Locator (Query Selector) - Enter the query selector class names of the card or element which contains the product information for the collections page.
    3. Collection Page Price Locator (Query Selector) - Enter the query selector of the price element inside each product card on the collections page.
    4. Delay After Page Load - Use the slider to add a delay (in milliseconds) to your page load to allow Custom Pricing to display the correct price information.

      Note: If the value is too low, customers may see incorrect pricing or hidden variants on the storefront. If the value is too high, customers may see price changes happen live.

    5. Delay After Content Change On Collection Page - Use the slider to add a time delay (in milliseconds) to content changes on collection pages. This allows Custom Pricing to locate and update prices if a filter/search is applied.

      Note: If the time value is too low, Custom Pricing may not have time to make price updates, If the value is too high, pricing changes may happen too slowly.

    6. Check For Variant Change - Use the slider to enter a time (in milliseconds) which Custom Pricing should use to check for updates when variants are changed by a customer on the product page.

      Note: Smaller intervals can add additional load on each browser. Longer intervals can cause a delay in price updates upon variant selection.

    7. Delay in each network call - Use the slider to increase the delay (in milliseconds) in each network call. This can reduce the load on browsers and increase page speeds. The delay needed can vary by theme. 
    8. Load All Collections - This attempts to load all data for your products and variants in collections to improve price calculation. If you are seeing incorrect pricing on your collection page, enabling this setting may help.

      Note: It is recommended to keep this disabled if possible. When enabled, Shopify may not be able to load all data, and an error may appear.

    9. In the Product Drawer section, adjust the following settings as needed:

      Note: This section is only relevant if your theme uses popups or drawers to show product information.

      1. Enable Support for Products in Drawers/Popups - Check this box to allow Custom Pricing to update pricing and display the quantity break grid.
      2. Listen to network calls starting with - Most themes make API calls to /product/ to fetch product information. If your theme is different, enter the location that appears in the URL.
      3. Product Drawer/Popup Locator (Query Selector) - Enter the query selector for the Drawer/Popup element.
  7. Click Save in the top right-hand corner.

 

Step 2: Add the quantity breaks grid to the product page

  1. Enable the Bold CSP v3 QB Grid app embed by sliding the toggle to the right.

    Bold CSP v3 QB Grid

  2. Click the arrow next to Bold CSP v3 QB Grid to expand the settings, and make the following adjustments:
    1. Query Selector For Element To Place QB Grid In - Enter the query selector of the area in which you’d like the grid to appear.
    2. Check For Variant Change (Product Page) - Use the slider to enter a time (in milliseconds) which Custom Pricing should use to check for updates when variants are changed by a customer on the product page.

      Note: Smaller intervals can add additional load on each browser. Longer intervals can cause a delay in price updates upon variant selection.

    3. Adjust the following settings to style the quantity breaks box without the use of code:
      1. Font size
      2. Font color (Header)
      3. Background Color (Header)
      4. Background Color (Even Row)
      5. Background Color (Odd Row)
      6. Font color (Body)
      7. Grid Border Size
      8. Grid Border Color
    4. (Optional) Additional CSS settings - Add custom CSS to style the quantity breaks grid.
  3. Click Save in the top right-hand corner.

 

Step 3: Show updated prices on the cart page

  1. Enable Bold CSP v3 Cart Prices by sliding the toggle to the right.

    Bold CSP v3 Cart Prices

  2. Click the arrow next to Bold CSP v3 Cart Prices and adjust the following settings as needed:

    Note: By default, these settings contain information relevant to the Dawn theme.

    1. Cart Item List Locator (Query Selector) - Enter the query selector for the list/table element cart items.
    2. Cart Total Value Locator (Query Selector) - Enter the CSS query selector for the total cart value element.
    3. Cart Item Locator (Query Selector) - Enter the CSS query selector for the cart items.
    4. Cart Item Price Locator(Query Selector) - Enter the CSS query selector for the price element of the line item.
    5. Cart Line Item Price Locator (Query Selector) - Enter the CSS query selector for the total line item value.
    6. Cart Item Price Locator (Query Selector) - Enter the CSS query selector for the price element of the line item.
    7. Checkout Button - Enter the CSS query selector for the checkout button element.
    8. Check For Cart Change - Use the slider to define the interval (in milliseconds) between the checks Custom Pricing makes to listen for cart updates.

      Note: Smaller intervals can add additional load on browsers, longer intervals can cause a delay between price updates.

    9. Enable SC Product Options Integration (Beta) - Enable this setting to integrate Custom Pricing with SC Product Options by Shop Circle. For more information, please visit Custom Pricing & SC Product Options Integration.
    10. Delay after cart change - Use the slider to define the interval (in milliseconds) that Custom Pricing will wait to display updated pricing in your cart drawer (AJAX cart).
  3. Click Save in the top right-hand corner.

 

V2 install instructions

Step 1: Show correct pricing on collections and product pages

  1. From your Shopify admin, navigate to Online Store > Themes.
  2. Click the Customize button next the theme you would like to install Custom Pricing on.
  3. Click App embeds from the left sidebar.

    Click on App embeds

  4. Enable the Bold Common For CSP V1/V2 and Bold CSP v2: Prices app embeds by moving the toggle to the right.

    Bold Common and CSP v2 Prices

  5. Optional: Click the arrow next to Bold Common For CSP V1/V2 to expand the settings, and change the following settings if needed:
    1. Load All Collections - This attempts to load all data for your products and variants in collections to improve price calculation. If you are seeing incorrect pricing on your collection page, you can enable this setting to test if this helps.

      Note: It is recommended to keep this disabled if possible. When enabled, Shopify may not be able to load all data and an error may appear.

    2. Delay Loading of Collection Data - This delay should only be increased if you are seeing a large increase in your collection page load times. An increased delay can reduce page load times. Use the slider to increase or decrease the delay (in milliseconds).

      Note:  Increasing the time delay can result in inaccurate pricing as Custom Pricing may not be able to display the correct prices on time.

  6. Click the arrow next to Bold CSP v2: Prices to expand the settings.

    Note: By default, these settings contain information relevant to the Dawn theme.

  7. In the Product and Collection Page section, make the following changes as needed for your theme:
    1. Delay After Page Load - Use the slider to add a delay (in milliseconds) to your page load to allow Custom Pricing to display the correct price information.

      Note: If the value is too low, customers may see incorrect pricing or hidden variants on the storefront. If the value is too high, customers may see price changes happen live.

    2. Check For Variant Change (Product Page) - Use the slider to define the time (in milliseconds) in between the checks Custom Pricing makes to listen for a variant change on the product page.

      Note: Smaller intervals can add additional load on each browser. Longer intervals can cause a delay in price updates upon variant selection.

    3. Delay Price Update by X milliseconds (Product Page) - This adds a delay when users change a variant to avoid pricing conflicts with your theme.

      Note: If the value is too low, customers may see incorrect pricing on the storefront. If the value is too high, customers may see price changes happen live.

    4. Product Price Locator (Query Selector) - Enter the CSS query selector for the price element from the product page.
    5. Collection Item Locator (Query Selector) - Enter the CSS query selector of the card or element which contains the product information for the collections page.
    6. Collection Page Price Locator (Query Selector) - Enter the CSS query selector of the price element inside each product card on the collections page.
    7. Delay After Content Change On Collection Page - Adjust the slider to add a time delay (in milliseconds) to content changes on collection pages. This allows Custom Pricing to locate and update prices if a filter/search is applied.

      Note: If the time value is too low, Custom Pricing may not have time to make price updates. If the value is too high, pricing changes may happen too slowly.

  8. In the Product Drawer section, make the following changes as needed for your theme:

    Note: This section is only relevant if your theme uses popups or drawers to show product information.

    1. Enable Support for Products in Drawers/Popups/Featured Blocks - Check this box to allow Custom Pricing to update pricing and display the quantity break grid.
    2. Listen to networks calls starting with - Most themes make API calls to /product/ to fetch product information. If your theme is different, enter the location that appears in the URL.
    3. Product Drawer/Popup Locator (Query Selector) - Enter the query selector for the drawer/popup element.
    4. Product Drawer/Popup Price Locator (Query Selector) - Enter the query selector for the drawer/popup/featured block.
  9. In the Search Results section, make the following changes as needed:
    1. Listen to network calls starts with - Most themes make API calls to /search to fetch product information. If your theme is different, enter the location that appears in the URL.
    2. Search Result Item Locator (Query Selector) - Enter the query selector for the search result item element.
    3. Search Result Item Price Locator (Query Selector) - Enter the query selector for the search result item's price element.
  10. In the Other Product Elements section, make the following changes as needed:
    1. Locator For Any Other Product Element (Query Selector) - Enter the query selector for the Product Cards or Elements which are not covered by other settings.
    2. Price Locator For Any Other Product Element (Query Selector) - Enter the query selector for the price element within the element found using the above selector.
  11. Click Save in the top right-hand corner.

 

Step 2: Add the quantity breaks grid to the product page

  1. Enable the Bold CSP v2 QB Grid app embed by sliding the toggle to the right.

    Bold CSP v2 QB Grid

  2. Click the arrow next to Bold CSP v2 QB Grid to expand the settings and make the following adjustments:
    1. Query Selector For Element To Place QB Grid In - Enter the query selector of the area in which you’d like the grid to appear.
    2. Check For Variant Change (Product Page) - Use the slider to enter a time (in milliseconds) which Custom Pricing should use to check for updates when variants are changed by a customer on the product page.

      Note: Smaller intervals can add additional load on each browser. Longer intervals can cause a delay in price updates upon variant selection.

    3. Delay loading of QB Grid (Product Page) - Use the slider to enter a time (in milliseconds) that delays the quantity break grid from loading on your page in order to allow your existing content/animations to load.

      Note: Smaller intervals can add additional load on each browser. Longer intervals can cause a delay in price updates upon variant selection.

    4. Adjust the following settings to style the quantity breaks box without the use of code:
      1. Font size
      2. Font color (Header)
      3. Background Color (Header)
      4. Background Color (Even Row)
      5. Background Color (Odd Row)
      6. Font color (Body)
      7. Grid Border Size
      8. Grid Border Color
    5. (Optional) Additional CSS settings - Add custom CSS to style the quantity breaks grid.
  3. Click Save in the top right-hand corner.

 

Step 3: Show updated prices on the cart page

  1. Enable the Bold CSP v2 Cart Prices app embed on your theme by moving the toggle to the right.

    Bold CSP v2 Cart Prices

  2. Click the arrow next to Bold CSP v2 Cart Prices to expand the settings and make the following adjustments as needed for your theme:

    Note: By default, these settings contain information relevant to the Dawn theme.

    1. Cart Total Value Locator - Enter the query selector for names for the total cart value element.
    2. Cart Item List Locator - Enter the query selector for the list/table element cart items.
    3. Cart Item Locator - Enter the query selector for the cart items.
    4. Line Item Total Price Locator - Enter the query selector for the total line item value.
    5. Cart Item Price Locator - Enter the query selector for the price element of the line item.
    6. Checkout Button - Enter the query selector for the checkout button element.
    7. Check For Cart Change - Use the slider to define the interval (in milliseconds) between the checks Custom Pricing makes to listen for cart updates.

      Note: Smaller intervals can add additional load on browsers, longer intervals can cause a delay between price updates.

    8. Delay Price Update - This adds a delay (in milliseconds) when users change a variant to allow Custom Pricing to display the correct price information.

      Note: If the value is too low, customers may see incorrect pricing or hidden variants on the storefront. If the value is too high, customers may see price changes happen live.

  3. Click Save in the top right-hand corner.

 

V1 install instructions

Step 1: Show the correct pricing on collections and product pages

  1. From your Shopify admin, navigate to Online Store > Themes.
  2. Click on the Customize button beside the theme you would like to add Custom Pricing to.
  3. Click App embeds from the left sidebar.

    Click App Embeds

  4. Enable the Bold Common For CSP V1/V2 and Bold CSP v1: Prices app embeds on your theme by sliding the toggle to the right.

    Bold Common For CSP v1/v2 and Bold CSP v1: Prices

  5. Optional: Click the arrow next to Bold Common For CSP V1/V2 to expand the settings, and change the following settings if needed:
    1. Load All Collections - This attempts to load all data for your products and variants in collections to improve price calculation. If you are seeing incorrect pricing on your collection page, you can enable this setting to test if this helps.

      Note: It is recommended to keep this disabled if possible. When enabled, Shopify may not be able to load all data and an error may appear.

    2. Delay Loading of Collection Data - This delay should only be increased if you are seeing a large increase in your collection page load times. An increased delay can reduce page load times. Use the slider to increase or decrease the delay (in milliseconds).

      Note:  Increasing the time delay can result in inaccurate pricing as Custom Pricing may not be able to display the correct prices on time.

  6. Click the arrow next to Bold CSP v1: Prices to expand the settings.

    Note: By default, these settings contain information relevant to the Dawn theme.

  7. In the For all pages section, use the sliders on the following settings to choose a time value (in milliseconds) that works for your theme:

    Note: If the value is too low, customers may see incorrect pricing or hidden variants on the storefront. If the value is too high, customers may see price changes happen live.

    1. Delay After Page Load - This adds a delay to your page load to allow Custom Pricing to display the correct pricing information.
    2. Delay Price Update - This adds a delay when users change a variant to allow Custom Pricing to display the correct pricing information.
  8. In the For Product Page section, adjust the following settings as needed:
    1. Product Price Locator (Query Selector) - Enter the query selector for the product price element.
    2. Option Element locator (Query Selector) - Enter the query selector for your theme’s variant options.
    3. Check For Variant Change - Use the slider to define the interval (in milliseconds) in between the checks Custom Pricing makes to listen for a variant change on the product page.

      Note: Smaller intervals can add an additional load on each browser. Longer intervals can cause a delay in price updates upon variant selection.

    4. Hide ‘Default Title’ options - This box should remain checked.
    5. Hide ‘Title’ Option in Product Form - This box should remain checked.
    6. Form Element Locator (Query Selector) - Enter the query selector for the variant title dropdown element.
  9. In the For All Other Pages (Index/Collections etc.) section, adjust the following settings as needed:
    1. Collection Item Locator (Query Selector) - Enter the CSS query selector of the card or element which contains the product information for the collections page.
    2. Collection Page Price Locator (Query Selector) - Enter the CSS query selector of the price element inside each product card on the collections page.
    3. Delay After Content Change On Collection Page - Use the slider to add a time delay (in milliseconds) to content changes on collection pages. This allows Custom Pricing to locate and update prices if a filter/search is applied.

      Note: If the time value is too low, Custom Pricing may not have time to make price updates. If the value is too high, pricing changes may happen too slowly.

  10. In the Hide Products section, adjust the following settings as needed:
    1. Hide Products with tag {CSPTAG}-HIDE - This box should remain checked.
    2. Products Content Container Locator (Query Selector) - Enter the query selector for the container that has product information on the product page.
    3. Search Item Locator (Query Selector) - Enter the query selector for the elements that appear as part of search.
    4. Listen to network calls starting with - Most themes use /search for their API calls to fetch results when searches are performed. If your theme is different, enter the comma separated URLs here. Partial URLs are accepted.
  11. In the Product Drawer section, adjust the following settings as needed:

    Note: This section is only relevant if your theme uses popups or drawers to show product information.

    1. Enable Support for Products in Drawers/Popups - Check this box to allow Custom Pricing to update pricing and display the quantity break grid.
    2. Listen to network calls starting with - Most themes make API calls to /product/ to fetch product information. If your theme is different, enter the location that appears in the URL.
    3. Product Drawer/Popup Locator (Query Selector) - Enter the query selector for the Drawer/Popup element.
  12. Click Save in the top right-hand corner.

 

Step 2: Add the quantity breaks grid to the product page

  1. Enable the Bold CSP v1 QB Grid app embed by sliding the toggle to the right.

    Bold CSP v1 QB Grid

  2. Click the arrow next to Bold CSP v1 QB Grid to expand the settings, and make the following adjustments:
    1. Query Selector For Element To Place QB Grid In - Enter the query selector of the area in which you’d like the grid to appear.
    2. Check For Variant Change (Product Page) - Use the slider to enter a time (in milliseconds) which Custom Pricing should use to check for updates when variants are changed by a customer on the product page.
    3. Delay loading of QB Grid (Product Page) - Use the slider to enter a time (in milliseconds) that delays the quantity break grid from loading on your page in order to allow your existing content/animations to load.
    4. Adjust the following settings to style the quantity breaks box without the use of code:
      1. Font size
      2. Font color (Header)
      3. Background Color (Header)
      4. Background Color (Even Row)
      5. Background Color (Odd Row)
      6. Font color (Body)
      7. Grid Border Size
      8. Grid Border Color
    5. (Optional) Additional CSS settings - Add custom CSS to style the quantity breaks grid.
  3. Click Save in the top right-hand corner.

 

Step 3: Show updated prices on the cart page

  1. Enable the Bold CSP v1 Cart Prices app embed by sliding the toggle to the right.

    Bold CSP v1 Cart Prices

  2. Click the arrow next to Bold CSP v1 Cart Prices to expand the settings, and make the following changes as needed:
    1. Checkout Button ID - Enter the ID of the checkout button element.
    2. Check For Cart Change - Use the slider to define the interval (in milliseconds) between the checks Custom Pricing makes to listen for cart updates.

      Note: Smaller intervals can add an additional load on browsers, longer intervals will cause delay between price updates.

    3. Delay after page load - Use the slider to add a delay (in milliseconds) to your page load to allow Custom Pricing to display the correct price information.

      Note: If the value is too low, customers may see incorrect pricing or hidden variants on the storefront. If the value is too high, customers may see price changes happen live.

    4. Clean up options in line items - This box should remain checked.
    5. Query Selector For Options in LineItem - Enter the query selector that locates the elements which contain Line item properties/descriptions.
    6. CSS settings - Add custom CSS to style the savings message that appears on the cart page when quantity break savings are present.
  3. Click Save in the top right-hand corner.

 


 

Manual Liquid code install instructions (legacy)

Alert: All new Custom Pricing installations can be performed using the instructions shown under Manual install instructions (via app embed) above. If you've installed Custom Pricing on a vintage theme prior to December 13, 2023, you will have the Liquid code installed to your theme as shown below.

V3 code install instructions

Step 1: Add Snippet Files

  1. Duplicate themes to create a backup copy.
  2. From the Shopify admin, select Online Store.
  3. Select Actions.
  4. Select Edit code.
  5. Under Snippets, find the bold-pr.liquid file.
  6. If this file doesn't exist:
    1. Select Add a new snippet.
    2. Enter the correct snippet name.
    3. Select Create snippet.

      Select create snippet

    4. Copy and paste the code from the bold-pr.liquid file:
      1. <script id="bold-platform-data" type="application/json">
        {
          "shop": {
            "domain": "{{ shop.domain }}",
            "permanent_domain": "{{ shop.permanent_domain }}",
            "url": "{{ shop.url }}",
            "secure_url": "{{ shop.secure_url }}",
            "money_format": {{ shop.money_format | json }},
            "currency": {{ shop.currency | json }}
          },
          "customer": {
            "id": {{ customer.id | json }},
            "tags": {{ customer.tags | json }}
          },
          "cart": {{ cart | json }},
          "line_item_products": {{ cart | map: "items"  | map: "product" | json }},
          "template": "{{ template | split: "." | first }}",
          "product": {{ product | json }},
          "collection": {{ collection.products | json }}
        }
        </script>
        {{ 'https://static.boldcommerce.com/bold-platform/sf/pr.js' | script_tag }}
        <style>
          .money[data-product-id], .money[data-product-handle], .money[data-variant-id], .money[data-line-index], .money[data-cart-total] {
            animation: moneyAnimation 0s 2s forwards; visibility: hidden;
          }
          @keyframes moneyAnimation { to { visibility: visible; } }
          .shappify_qb_grid {
            width: auto;
            background: #fff;
            margin: 8px 0;
          }
          .shappify_qb_grid, .shappify_qb_grid td, .shappify_qb_grid th {
            text-align: left;
            padding: 5px;
            border: 1px solid #ccc;
            border-collapse: collapse;
          }
        </style>
  7. Click Save.

 

Step 2: Edit theme.liquid

  1. Under Layout, select theme.liquid.
  2. Copy and paste the following code below the {{ content_for_header }} line:
    {%- render 'bold-pr' -%}

    copy and paste the code

  3. Click Save.

 

Step 3: Add the Product Loop Code

Updates need to be done on all theme files that output product prices on the store. The number and name of these files vary from theme to theme. Generally, 3-5 files need to be updated.

These control the product information on the product, collection, search, related products, and home pages.

It's important that each theme file that pulls this information be modified. This is to ensure the correct pricing always shows for your customers.

Note: This requirse you to go back and edit multiple files within your theme coding.

Go through the list of files one at a time and reference your theme's files to see if that particular file exists in your theme. Not all of these files exist in a given theme.

 

List of Theme Files to Update:

  • Templates: Themes should contain most of these files. If your theme is using Sections, these files should be located within the Sections folder as *-template.liquid files.
    • collection.liquid
    • list-collections.liquid
    • search.liquid
  • Sections & Snippets: Any given theme should typically have a few of these files.
    • collection-template.liquid
    • featured-collection.liquid
    • product-full.liquid
    • product-loop.liquid
    • product-recommendations.liquid
    • product-slider.liquid
    • related-products.liquid

Not all of these will appear in a given file, but the ones that do may appear several times.

 

Code Adjustments Required:

Your theme's product loop code should look similar to this:

{% for product in collection.products %}

Find the code

The following code should be inserted directly after each instance:

<script type="application/json" class="bold-product-json">{{ product | json }}</script>

Paste the code

In some cases, the product loop code may look slightly different:

{% for item in search.results %}

Find the code

We then need to adjust the end of our Bold price code to include the loop's product reference:

  •     Some themes will use a slight variation of this code. The first half of this code will use one of the following:
    
        {% for product in
        {% for prod in
        {% for item in
    
    The second half will be a variation of the following:
    
        selected_collection.products %}
        collection.products %}
        search.results %}
        collection.all.products %}
        collections.all.products %}
        product_collection.products %}
        products %}
        product-list.products %}
        recommendations.products %}
        featured_collection.products %}
        featuredCollection.products %}
        link.object.products %}
        collection_products %}
        coll.products %}
        collection %}
        collections %}
    
<script type="application/json" class="bold-product-json">{{ item | json }}</script>

Paste the code

 

Step 4: Update the Product Price Code

Updates need to be done on all theme files that output product prices on the store. The number and name of these files vary from theme to theme. Generally, 3-5 files will need to be updated.

These control the price fields on the product, collection, search, related products, and home pages.

It's important that each theme file that outputs a price be modified. This is to ensure the correct pricing always shows for your customers.

Note: This requires you to go back and edit multiple files within your theme coding.

Go through the list of files one at a time and reference your theme's files to see if that particular file exists in your theme. Not all of these files exist in a given theme.

 

List of Theme Files to Update:

  • Templates: Themes should contain most of these files. If your theme is using Sections, these files are located within the Sections folder as *-template.liquid files.
    • product.liquid
    • index.liquid
    • collection.liquid
    • search.liquid
  • Sections & Snippets: Any given theme should typically have a few of these files.
    • featured-product.liquid
    • product-card.liquid
    • product-grid-item.liquid
    • product-form.liquid
    • product-template.liquid
    • related-products.liquid

 

Code Adjustments Required:

Your theme's product price code should look similar to this:

{{product.price | money}}

Find the code

The following code should be placed around each of these instances with the <span> tags wrapping this price code:

<span class="money" data-product-id="{{ product.id }}">{{ product.price | money }}</span>

Paste the code

In some cases, the product price code may look slightly different:

{{ item.price | money }}

Find the code

The following code should still be placed around each of these instances with the <span> tags wrapping this price code:

<span class="money" data-product-id="{{ item.id }}">{{ item.price | money }}</span>

Paste the code

  • Some themes will use a slight variation of this code. If you can't find it, try looking for the following instead:
    
        {{ price | money }}
        {{ price }}
        {{ formatted_price }}
        {{ money_price }}
        {{ product.price | money }}
        {{ item.price | money_without_trailing_zeros }}
        {{ item.price | money }}
        {{ current_variant.price | money }}
    

 

Step 5: Update the Cart Price Code

Updates need to be done on all theme files that pull your product price information to the cart. The number and name of these files will vary from theme to theme. Generally, 3-5 files will need to be updated.

It's important that each theme file that outputs a price be modified. This is to ensure the correct information always shows for your customers.

Note:: This will require you to go back and edit multiple files within your theme coding.

Go through the list of files one at a time and reference your theme's files to see if that particular file exists in your theme. Not all of these files will exist in a given theme.

 

List of Theme Files to Update:

  • Templates: If your theme is using Sections, these files will be located within the Sections folder as *-template.liquid files.
    • cart.liquid
  • Sections & Snippets:
    • cart-ajax.liquid
    • cart-content.liquid
    • cart-template.liquid

 

Code Adjustments Required:

First, you'll need to find each instance of coding that looks similar to this:

{{ item.price | money }}

Find the code

The following code should be placed around each of these instances with the <span> tags wrapping this code:

<span class="money" data-line-index="{{ forloop.index0 }}">{{ item.price | money }}</span>

Paste the code

Next you'll need to find each instance of coding that looks similar to this:

{{ item.line_price | money }}

Find the code

The following code should be placed around each of these instances with the <span> tags wrapping this code:

<span class="money" data-line-total data-line-index="{{ forloop.index0 }}">{{ item.line_price | money }}</span>

Paste the code

Lastly, you'll need to find each instance of coding that looks similar to this:

{{ cart.total_price | money }}

Find the code

The following code should be placed around each of these instances with the <span> tags wrapping this code:

<span class="money" data-cart-total>{{ cart.total_price | money }}</span>

Paste the code

 

Step 6: Optional - Place the Quantity Breaks Grid

If you're using the Quantity Breaks module with Custom Pricing, you may want to manually place where the grid displays on the storefront.

To choose the placement of your grid, please follow these steps:

  1. Under Templates, select product.liquid.

    Note: If your theme is using Sections, the contents for this file may be within product-template.liquid.

  2. Find where you want to place your quantity breaks grid in the code.

    Note: Generally, most store owners place this grid code either above or below their quantity selector.

    Find the placement

  3. Copy and paste the following code in your desired location:
    <div class="bold_qb_grid" data-variant-id="{{ product.selected_or_first_available_variant.id }}"></div>

    Paste the code

  4. Click Save.

 

Step 7: Install the AJAX Scripts

Note: Not all of the following coding snippets need to be inserted into your theme. You need to determine the function your theme uses to build your AJAX modals and install the appropriate coding from there. This section requires advanced knowledge of JavaScript and web coding to complete. If you are not comfortable with this, please contact our Customer Success team for further assistance.

For themes that use AJAX functionalities, updates must be made to the JavaScript files that build these AJAX pages and/or modals. The file name and location of this code vary from theme to theme.

Note: This is only required for themes that have AJAX functions.

These updates are done to ensure the correct product price displays every time it's shown on your storefront. This may require you to go back and edit multiple files in your theme coding.

 

List of Theme Files to Update:

  • Assets: Your theme may contain one or a few of these files. The required coding adjustment(s) are explained in the next section.
    • ajax-cart.js.liquid
    • ajaxify-cart.js.liquid
    • ajaxify-shop.js.liquid
    • ajaxify.js.liquid
    • app.js
    • apps.js
    • atlantic.js* - Atlantic by Pixel Union
    • colors-ajax-cart.js.liquid* - Colors by Small Victories
    • ella.js* - Ella by Halo Themes
    • empire.js* - Empire by Pixel Union
    • functions.min.js
    • handy.js* - Handy by Pixel Union
    • jas_theme.min.js
    • js_main.js
    • main.js.liquid
    • script.js.liquid
    • script.min.js
    • sections.js.liquid
    • shop.js.liquid
    • site.js.liquid
    • superstore.js* - Superstore by Pixel Union
    • theme.js
    • theme.js.liquid
    • theme.min.js
    • timber.js.liquid
    • vendor.min.js

* = Theme specific file. The theme name and developer are noted beside the file name.

 

Code Adjustments Required:

Themes that pass cart objects between your regular cart and the AJAX modals need to use our Cart Doctor function.

Most themes use the function buildCart to show your products in their AJAX modals and pass this information between both areas.

You need to find where this code is in one of the above files, and paste the following code within this function:

// Bold:PRE
if (typeof window.BOLD !== 'undefined'
&& typeof window.BOLD.common !== 'undefined'
&& typeof window.BOLD.common.cartDoctor !== 'undefined') {
// NOTE: "cart" should be the variable containing the cart JSON data
cart = window.BOLD.common.cartDoctor.fix(cart);
}
// Bold:PRE

Build Cart Example

Some themes may use the function refreshCart to show your items in these modals.

You need to find where this code is in one of the above files, and paste the following code within this function:

// Bold:PRE
if (typeof window.BOLD !== 'undefined'
&& typeof window.BOLD.common !== 'undefined'
&& typeof window.BOLD.common.cartDoctor !== 'undefined') {
// NOTE: "cart" should be the variable containing the cart JSON data
cart = window.BOLD.common.cartDoctor.fix(cart);
}
// Bold:PRE

Refresh Cart Example

Themes that simply display the information from your cart in the AJAX modals need to use our Event Emitter function.

Most themes will pull this information by using the getCartData function.

Note: If Bold Upsell's AJAX code is already installed on your theme, you do not need to install this code. It should already be contained in your theme files.

You need to find where this code is in one of the above files, and paste the following code within this function:

// Bold:PRE
if (window.BOLD && BOLD.common && BOLD.common.eventEmitter &&
typeof BOLD.common.eventEmitter.emit === 'function'){
BOLD.common.eventEmitter.emit('BOLD_COMMON_cart_loaded');
}
// Bold:PRE

Get Card Example

Some themes grab this information through the updateView function.

You need to find where this code is in one of the above files, and paste the following code within this function:

// Bold:PRE
if (window.BOLD && BOLD.common && BOLD.common.eventEmitter &&
typeof BOLD.common.eventEmitter.emit === 'function'){
BOLD.common.eventEmitter.emit('BOLD_COMMON_cart_loaded');
}
// Bold:PRE

Update View Example

 

V1 & V2 code install instructions

This installation allows both the Custom Pricing and Quantity Breaks modules to work correctly on your store.

Note: This installation does not work for themes using render tags. You will need to switch to Version 3 of Custom Pricing or use a theme that can work with include tags. Please visit Shopify Render Tag Adjustments for more information.

Step 1: Add Snippet Files

  1. Duplicate themes to create a backup copy.
  2. From the Shopify admin, select Online Store.
  3. Select Actions.
  4. Select Edit code.
  5. Under Snippets, find these seven files:
    • bold-cart.liquid
    • bold-cart-item.liquid
    • bold-common.liquid
    • bold-includes.liquid
    • bold-csp-metafield-variant.liquid
    • bold-product.liquid
    • bold-variant.liquid
  6. For any that don't exist:
    1. Select Add a new snippet.
    2. Enter the correct snippet name.
    3. Select Create snippet.

      select create snippet

    4. Copy and paste the code found in each of these links into their respective files:
      1. <!-- bold-cart.liquid -->
        {% comment %} Last updated 2016-07-18 {% endcomment %}
        {% capture bold_cart_liquid %}
        {% comment %}
        BOLD-CART.LIQUID - Universal Bold Cart Updater
        This file creates liquid variables to assist in updating line items in cart.liquid.
        
        USED BY: Product Options, Product Builder, Recurring Orders
        REQUIRES: bold-cart-item.liquid, bold.css
        
        To use this file:
        * Include this file at the beginning of cart.liquid and before any quick-carts in your template
        	Example: {% include 'bold-cart' %}
        
        
        * Make the following replacements.
        	bold_cart_total_price        replaces	cart.total_price
        	bold_cart_item_count         replaces	cart.item_count
        
        * Follow the install instructions for your app to see where these variables need to be inserted
          (See bold-cart-item.liquid for additional installation requirements)
        
          PRODUCT OPTIONS
            bold_cart_item_count             replaces 	cart.item_count
            {{ bold_edit_in_cart }}          inserted	At the end of cart.liquid
        
          RECURRING ORDERS
            bold_cart_total_price            replaces	cart.total_price
            {{ bold_ro_cart }}               inserted	Inside the cart form where you would like the Recurring Cart widget to appear
            show_paypal			    		 inserted	Inside "if additional_checkout_buttons" (Becomes "if additional_checkout_buttons and show_paypal")
        
          PRODUCT BUILDER
            bold_cart_item_count             replaces 	cart.item_count
        
          BUY THE MEASURE
            bold_cart_item_count             replaces 	cart.item_count
        
        {% endcomment %}
        {% if cart %}
          {% assign bold_cart = cart %}
          {% assign bold_item_list = bold_cart.items %}
        {% elsif checkout %}
          {% assign bold_cart = checkout %}
          {% assign bold_item_list = checkout.line_items %}
        {% endif %}
        
        {% assign is_mixed_cart = false %}
        {% assign show_paypal = true %}
        {% assign bold_cart_total_price = 0 %}
        {% assign bold_cart_item_count =  0 %}
        
        {% for bold_cart_item in bold_item_list %}
                {% comment %} Apps like Persistent Cart can kill apps like options by stripping out property fields. This is a mini-failsafe to catch most instances where priced options have become visible due to property stripping {% endcomment %}
        	{% if bold_cart_item.product.type == 'OPTIONS_HIDDEN_PRODUCT' and bold_cart_item.properties.builder_id == blank and bold_cart_item.properties._builder_id == blank %}
        	  <script>window.location.href='/cart/clear'</script>
        	{% endif %}
        
        	{% include 'bold-cart-item' with bold_cart_item %}
        	{% if bold_hidden_item %}{% continue %}{% endif %}
        
        	{% assign bold_cart_total_price = bold_cart_total_price | plus: bold_item_line_price %}
        
        	{% comment %} Update item count. {% endcomment %}
            {% assign bold_cart_item_count  = bold_cart_item_count | plus: bold_item_quantity %}
        
        	{% if is_mixed_cart == false and bold_cart_item.properties.frequency_type_text and bold_cart_item.properties.frequency_num %}
        		{% assign is_mixed_cart = true %}
                {% assign show_paypal = false %}
        		<style>[name*="goto_"] { display:none !important }</style>
        	{% endif %}
        {% endfor %}
        
        {% comment %} Check to see if something went wrong - if we only have priced options left, clear the cart {% endcomment %}
        {% if bold_cart_item_count == 0 and bold_cart.item_count > 0 %}<script>window.location.href = '/cart/clear';</script>{% endif %}
        
        {% capture bold_ro_cart %}
          {% if shop.metafields.bold_rp.recurring_type == 0 or shop.metafields.bold_rp.recurring_type == 2 %}
            <input name="shopify_customer_id" type="hidden" value="{{ customer.id }}" >
            <input name="email" type="hidden" value="{{ customer.email }}" >
            <input name="address1" type="hidden" value="{{ customer.default_address.address1 }}" >
            <input name="address2" type="hidden" value="{{ customer.default_address.address2 }}" >
            <input name="city" type="hidden" value="{{ customer.default_address.city }}" >
            <input name="company" type="hidden" value="{{ customer.default_address.company }}" >
            <input name="country" type="hidden" value="{{ customer.default_address.country }}" >
            <input name="first_name" type="hidden" value="{{ customer.default_address.first_name }}" >
            <input name="last_name" type="hidden" value="{{ customer.default_address.last_name }}" >
            <input name="phone" type="hidden" value="{{ customer.default_address.phone }}" >
            <input name="province" type="hidden" value="{{ customer.default_address.province }}" >
            <input name="zip" type="hidden" value="{{ customer.default_address.zip }}" >
            <div class='product_rp_cart_div'></div>
          {% endif %}
        {% endcapture %}
        
        {% capture bold_scripts %}
        <script async src="//secure.apps.shappify.com/apps/options/bold_cart_handler.php?shop={{shop.permanent_domain}}"></script>
        <script>
          var Bold = Bold || {};
        	Bold.updateQtyBoxes = function(){
        	  /* First make sure all ratio information is properly set */
        	  jQuery.each(jQuery('[data-bold-ratio]'), function(index, obj){
        	    if(parseInt(jQuery(obj).data('bold-ratio')) != 1){
        	      /* The quantity displayed and the quantity passed to checkout are separate - create a hidden input with the true quantity */
        	      if(jQuery(obj).find('[name="updates[]"]').length && !jQuery(obj).find('.bold-true-quantity').length){
        	        jQuery(obj).find('[name="updates[]"]').addClass('bold-display-quantity').removeAttr('name').parent().append('<input type="hidden" name="updates[]" class="bold-true-quantity">');
        	      }
        	    }
        	  });
        
        	  /* Now loop through all rows that have nonstandard quantity behaviour and set the correct quantity */
        	  jQuery.each(jQuery('[data-bold-ratio], .bold-master'), function(index, obj){
        	    var multiplier = parseInt(jQuery(obj).data('bold-ratio')) || 1;
        
        	    /* Find the base quantity value that we're basing the update on */
        	    var baseQty;
        	    if(jQuery(obj).find('.bold-display-quantity').length){
        	      baseQty = parseInt(jQuery(obj).find('.bold-display-quantity').val());
        	    }
        	    else{
        	      baseQty = parseInt(jQuery(obj).find('[name^=updates]').val());
        	    }
        	    if(isNaN(baseQty)) return; /* Abort this round if there's no base quantity to be found */
        
        	    /* Loop through all matching builder IDs to update. The name=updates will always hold the true quantity, a display-quantity (if it exists) will hold a 'faked' quantity based on the ratio */
        	    var components = jQuery(obj).closest('form').find('[data-bold-id=' + jQuery(obj).data('bold-id') + ']');
        	    if(components.length){
        	      jQuery.each(jQuery(components), function(cindex, component){
        	        var multiplier = parseInt(jQuery(component).data('bold-ratio')) || 1;
        
        	        if(jQuery(component).hasClass('bold-one-time-charge')){
        	          jQuery(component).find('[name*="updates"]').val(multiplier);
        	          jQuery(component).find('.bold-display-quantity').val(1);
        	        }else{
        	          jQuery(component).find('[name*="updates"]').val(multiplier * baseQty);
        	          jQuery(component).find('.bold-display-quantity').val(baseQty);
        	        }
        	      });
        	    }
        	    else{
        	      /* No builder ID, so we just have to worry about the multiplier ratio on this line */
        	      jQuery(obj).find('[name*="updates"]').val(multiplier * baseQty);
        	      jQuery(obj).find('.bold-display-quantity').val(baseQty);
        	    }
        	  });
        	};
        
          var update_qty_builder = Bold.updateQtyBoxes;
        
          function remove_product_builder(builder_id){
            jQuery('[data-bold-id="'+ builder_id +'"] [name*="updates"]').val(0);
            jQuery('[data-bold-id]').closest('form').submit();
          }
          function trigger_qty_update(){
            setTimeout(function(){jQuery('.bold-master [name*="updates"]').trigger('change');}, 100);
          }
        
          if(typeof(jQuery)!='undefined' && typeof(Bold)=='object' && typeof(Bold.updateQtyBoxes)=='function')
            jQuery(document).on('submit', 'form[action*="cart"]', Bold.updateQtyBoxes);
        
          if(typeof(jQuery)!='undefined' && typeof(Bold)=='object' && typeof(Bold.updateQtyBoxes)=='function')
            jQuery(document).on('change', '[name*="updates"]', Bold.updateQtyBoxes);
        </script>
        {% endcapture %}
        
        {% comment %} Output variables for Rivets-based carts {% endcomment %}
        {% assign bold_rivets_row_data = ' rv-class-bold-hidden="item.is_hidden" rv-class-bold-master="item.is_master" rv-data-bold-id="item.builder_id" rv-data-line="item.line" rv-data-bold-ratio="item.qty_ratio" ' %}
        {% assign bold_rivets_item_properties = '<div rv-html="item.formatted_properties"></div>' %}
        {% assign bold_rivets_recurring_desc = '<div rv-html="item.formatted_recurring_desc"></div>' %}
        
        {% capture bold_rivets_script %}
        {{ bold_scripts }}
        <script>
          if(typeof(BOLD)==='object' && BOLD.helpers && typeof(BOLD.helpers.rivetsInit)==='function')
            BOLD.helpers.rivetsInit();
        </script>
        {% endcapture %}
        
        {% capture bold_edit_in_cart %}
        {{ bold_scripts }}
        <div class="modal fade" style="display: none;" id="bold-cart-modal" aria-labelledby="boldcartmodal" tabindex="-1" role="dialog" aria-hidden="true">
          <div class="modal-dialog">
            <div class="modal-content">
              	<div class="modal-body">
                <div class="bold-image"></div>
                <div class="bold-title"></div>
                <div class="bold-price"></div>
                <div class="bold-desc"></div>
                <div class="bold-options"></div>
            	</div>
            </div>
          </div>
        </div>
        {% endcapture %}
        
        {% capture bold_cart_quantity_check %}
        <script>
          /* Control quantities for variant-swapping apps */
          var Bold=Bold || {};
          Bold.updateQtyMax = function(){
            jQuery.each(jQuery('[data-bold-inventory-policy="deny"][data-bold-base-variant]'), function(index, obj){
        
              var total = jQuery(obj).data('bold-inventory-quantity');
        
              /* Find number in the cart, remembering that multiple lines may have the same base variant */
              var current = 0;
              jQuery.each(jQuery('[data-bold-base-variant="' + jQuery(obj).data('bold-base-variant') + '"] [name^="updates"]'),function(qtyIndex,qtyObj){
                current += parseInt(jQuery(qtyObj).val());
              });
        
              var remaining = total - current;
        
              /* Update maximums for cart quantity boxes */
              if(jQuery(obj).find('[name^="updates"]').length){
                /* Each line's quantity box maximum is the current line quantity plus the number remaining */
                var max = parseInt(jQuery(obj).find('[name^="updates"]').val()) + remaining;
                jQuery(obj).find('[name^="updates"]').attr('max', max);
              }
              /* Update maximums for product-page quantity boxes */
              else if(jQuery(obj).attr('name').indexOf('quantity') != -1){
                jQuery(obj).attr('max', max);
              }
            });
          };
        
          /* Run function when updating the quantity box */
          jQuery(document).on('change', '[data-bold-inventory-policy="deny"] [name*="updates"], [data-bold-inventory-policy="deny"][name*="quantity"]', function(){
            var precheck = parseInt(jQuery(this).val());
            var max = parseInt(jQuery(this).attr('max'));
            if(precheck > max){
              /* Force the box down to the maximum value if a user manages to input a larger number */
              jQuery(this).val(jQuery(this).attr('max'));
        
              if(typeof(qty_error_message)==='function')
                qty_error_message(max, precheck);
            }
        
            Bold.updateQtyMax();
          });
          jQuery(window).load(function(){
            Bold.updateQtyMax();
            jQuery('[data-bold-inventory-policy="deny"] [name*="updates"]').trigger('change');
          });
        
        </script>
        {% endcapture %}
        
        <script>window['mixed_cart'] = {{ is_mixed_cart }};</script>
        {% endcapture %}{{ bold_cart_liquid | strip_newlines }}
      2. <!-- bold-cart-item.liquid -->
        {% comment %} Last updated 2018-May-14 {% endcomment %}
        {% capture bold_cart_item_liquid %}
        {% comment %}
        BOLD-CART-ITEM.LIQUID - Universal Bold Cart Updater
        This file creates liquid variables to assist in updating line items in cart.liquid.
        
        USED BY: Product Options, Recurring Orders, Product Builder
        REQUIRES: bold.css
        
        To use this file:
        * Include this file immediately after the start of the item loop in the cart.
        	Example: {% include 'bold-cart-item' with item %}
        
        
        * Make the following replacements.
        	bold_item_price         replaces	item.price
        	bold_item_line_price    replaces	item.line_price
        
        * Follow the install instructions for your app to see where these variables need to be inserted
          (See bold-cart.liquid for additional installation requirements)
        
          PRODUCT OPTIONS
            {{ bold_row_class }}         inserted	Inside the class attribute of the first row after  "for item in cart.items"
            {{ bold_row_data }}          inserted	Inside the first row tag, outside of any other attributes
            {{ bold_remove_class }}      inserted	Inside the class attribute of the remove button
            {{ bold_remove_href }}       replaces	Relpaces the existing href attribute of the remove button
            {{ bold_remove_attr }}       inserted	Inside the remove element's tag, outside of any other attributes
            {{ bold_qty_class }}         inserted	Inside the class attribute of the quantity box
            {{ bold_qty_attr }}          inserted	Inside the quantity box input tag, outside of any other attributes
            {{ bold_item_properties }}   inserted	Placed where you want the selected options to display, usually shortly after the {{ item.title }}
            {{ bold_qty_button_attr }} 	 inserted	Inside any +/- buttons on the cart.liquid page (if they exist)
        
          RECURRING ORDERS
            {{ bold_remove_class }}      inserted	Inside the class attribute of the remove button
            {{ bold_recurring_desc }}    inserted	Placed where you want the recurring orders description to appear, usually shortly after the {{ item.title }}
            (See bold-cart.liquid for additional installation requirements)
        
          PRODUCT BUILDER
            {{ bold_row_class }}         inserted	Inside the class attribute of the first row after  "for item in cart.items"
            {{ bold_row_data }}          inserted	Inside the first row tag, outside of any other attributes
            {{ bold_remove_class }}      inserted	Inside the class attribute of the remove button
            {{ bold_remove_href }}       replaces	Relpaces the existing href attribute of the remove button
            {{ bold_remove_attr }}       inserted	Inside the remove element's tag, outside of any other attributes
            {{ bold_qty_class }}         inserted	Inside the class attribute of the quantity box
            {{ bold_qty_attr }}          inserted	Inside the quantity box input tag, outside of any other attributes
            {{ bold_qty_button_attr }} 	 inserted	Inside any +/- buttons on the cart.liquid page (if they exist)
            {{ bold_item_properties }}   inserted	Placed where you want the selected options to display, usually shortly after the {{ item.title }}
            {{ bold_builder_img_src }} inserted	Wrap the image tag with {% if bold_builder_img_src != blank %}<img src="{{ bold_builder_img_src }}" alt="{{ bold_builder_img_alt }}" />{% else %} <!-- Original Image Code --> {% endif %}
            {{ bold_builder_img_alt }} inserted	See bold_builder_image_src above
            {{ bold_builder_href }}      replaces	item.url (Some themes use item.product.url or item.variant.url instead)
        
          BOLD D&H
            {{ bold_qty_attr }}          inserted       Inside the quantity box input tag, outside of any other attributes
        
          BUY THE MEASURE
            {{ bold_qty_class }}         inserted       Inside the class attribute of the quantity box
        
          QUANTITY BREAKS, CUSTOMER PRICING, PRODUCT BUNDLES
            {{ bold_row_data }}          inserted	Inside the first row tag, outside of any other attributes
            ** Inventory control also requires bold-variant-inventory.liquid and bold-base-variant.liquid
            (See bold-cart.liquid for additional installation requirements)
        
        {% endcomment %}
        
        {% comment %} SET UP DEFAULTS BEFORE ANY APP INTERFERENCE {% endcomment %}
        
        {% assign bold_cart = bold_order | default: cart | default: checkout %}
        {% assign bold_item_list = bold_cart.items | default: bold_cart.line_items %}
        
        {% assign bold_item = bold-cart-item %}
        {% assign bold_item_price = bold_item.price %}
        {% assign bold_item_quantity = bold_item.quantity %}
        
        
        {% include 'bold-variant' with bold_item.variant, base_product: bold_item.product, line_item: bold_item %}
        {% assign bold_item_price = bold_variant_price | default: bold_item_price %}
        
        
        {% assign bold_hidden_item = false %}
        
        {% comment %} ATTRIBUTES FOR THE CART ROW {% endcomment %}
        {% if bold_item.properties.builder_id != blank %}
          {% assign builder_id = 'builder_id' %}
          {% assign master_builder = 'master_builder' %}
        {% else %}
          {% assign builder_id = '_builder_id' %}
          {% assign master_builder = '_master_builder' %}
        {% endif %}
        {% if bold_item.properties[master_builder] != blank %}
          {% assign bold_row_class = 'bold-row bold-master bold-row-' | append: bold_item.properties[builder_id] %}
          {% assign bold_row_data = 'data-bold-id="' | append: bold_item.properties[builder_id] | append: '"' %}
        {% elsif bold_item.properties[builder_id] != blank %}
          {% assign bold_row_class = 'bold-row bold-hidden bold-row-' | append: bold_item.properties[builder_id] %}
          {% assign bold_row_data = 'data-bold-id="' | append: bold_item.properties[builder_id] | append: '"' %}
          {% assign bold_hidden_item = true %}
        {% else %}
          {% assign bold_row_class = '' %}
          {% assign bold_row_data = '' %}
        {% endif %}
        
        {% comment %} ADDITIONAL DATA FOR THE CART ROW {% endcomment %}
        {% capture bold_qty_check %}{% include 'bold-variant-inventory' %}{% endcapture %}
        {% unless bold_qty_check contains 'Liquid error' %}
          {% assign bold_row_data = bold_row_data | append: ' data-bold-inventory-policy=' | append: bold_variant_inventory_policy %}
          {% assign bold_row_data = bold_row_data | append: ' data-bold-inventory-quantity=' | append: bold_variant_inventory_quantity %}
          {% assign bold_row_data = bold_row_data | append: ' data-bold-base-variant=' | append: bold_variant_inventory_base_id %}
        {% endunless %}
        
        {% comment %} CHECK FOR RATIO PROPERTIES {% endcomment %}
        {% assign bold_ratio = 1 %}
        {% if bold_item.properties._bold_ratio %}
          {% assign bold_ratio = bold_ratio | times: bold_item.properties._bold_ratio %}
        {% elsif bold_item.properties._btm_ratio %}
          {% assign bold_ratio = bold_ratio | times: bold_item.properties._btm_ratio %}
        {% endif %}
        {% assign bold_row_data = bold_row_data | append: ' data-bold-ratio=' | append: bold_ratio %}
        
        
        {% comment %} UNIT PRICE AND QUANTITY WITH BUY THE MEASURE {% endcomment %}
        {% if bold_ratio != 1 %}
          {% assign bold_item_quantity = bold_item_quantity | divided_by: bold_ratio %}
          {% assign bold_item_price = bold_item.price | times: bold_ratio %}
        {% endif %}
        
        {% comment %} TOTAL PRICE WITH PRICED OPTIONS {% endcomment %}
        {% if bold_item.properties[master_builder] != blank %}
          {% if bold_item.properties._extra_price %}
          {% comment %} PRICE IS ATTACHED TO THE MASTER, NO NEED TO LOOP THROUGH CART {% endcomment %}
            {% assign bold_item_price = bold_item.price %}
            {% for bold_extra in  bold_item.properties._extra_price %}
              {% assign bold_item_price = bold_item_price | plus: bold_extra.last %}
            {% endfor %}
          {% else %}
          {% comment %} OLD INSTALL, NEED TO LOOP THROUGH ENTIRE CART {% endcomment %}
            {% assign bold_item_price = 0 %}
            {% for po_item in bold_item_list %}
        
              {% if bold_item.properties[builder_id] == po_item.properties[builder_id] %}
        
                {% comment %} CHECK FOR RATIO PROPERTIES {% endcomment %}
                {% assign po_ratio = 1 %}
                {% if po_item.properties._bold_ratio %}
                  {% assign po_ratio = po_ratio | times: po_item.properties._bold_ratio %}
                {% elsif po_item.properties._btm_ratio %}
                  {% assign po_ratio = po_ratio | times: po_item.properties._btm_ratio %}
                {% endif %}
        
                {% assign bold_item_price = po_ratio | times: po_item.price | plus: bold_item_price %}
              {% endif %}
            {% endfor %}
          {% endif %}
        {% endif %}
        
        {% comment %} APPLY RECURRING ORDERS DISCOUNT, IF SET (ONLY FOR V2 RO) {% endcomment %}
        {% if bold_item.properties._ro_discount_percentage %}
          {% assign bold_ro_multiplier = 100.00 | minus: bold_item.properties._ro_discount_percentage | times: 0.01 %}
          {% assign bold_original_price = bold_item_price %}
          {% assign bold_item_price = bold_item_price | times: bold_ro_multiplier | round %}
        {% endif %}
        
        {% comment %} SET LINE ITEM PRICE {% endcomment %}
        {% assign bold_item_line_price = bold_item_price | times: bold_item_quantity %}
        
        {% comment %} HELPER VARIABLES FOR REMOVE BUTTON {% endcomment %}
        {% if bold_item.properties[master_builder] != blank %}
          {% assign bold_remove_href = '#' %}
          {% assign bold_remove_attr = 'onclick="remove_product_builder(' | append: "'" | append: bold_item.properties[builder_id] | append: "'" | append: ');"' %}
          {% assign bold_remove_class = bold_item.properties[builder_id] | append: '_remove bold-ro-remove' %}
        {% else %}
          {% assign bold_remove_href = '/cart/change?line=' | append: forloop.index | append: '&quantity=0' %}
          {% assign bold_remove_attr = '' %}
          {% assign bold_remove_class = 'bold-ro-remove' %}
        {% endif %}
        
        {% comment %} HELPER VARIABLES FOR QUANTITY BOX {% endcomment %}
        {% assign options_readonly = false %}
        {% if bold_helper_loaded and bold_item.properties[builder_id] != blank %}
          {% assign bold_qty_attr = 'onchange="Bold.updateQtyBoxes();"' %}
          {% assign bold_qty_class = bold_item.properties[builder_id] | append: '_qty' %}
        {% elsif bold_item.properties[builder_id] != blank %}
          {% assign bold_qty_attr = 'onchange="update_qty_builder(' | append: "'" | append: bold_item.properties[builder_id] | append: "'" | append: ', this);"' %}
          {% assign bold_qty_class = bold_item.properties[builder_id] | append: '_qty' %}
          {% if bold_item.properties[master_builder] == blank %}{% assign options_readonly = true %}{% endif %}
        {% else %}
          {% assign bold_qty_attr = '' %}
          {% assign bold_qty_class = '' %}
        {% endif %}
        {% if options_readonly or bold_item.product.metafields.inventory.ShappifyHidden == "true" or bold_item.variant.metafields.bold_measurement.formula %}
          {% assign bold_qty_attr = bold_qty_attr | append: ' readonly="readonly"' %}
        {% endif %}
        {% if bold_item.variant.metafields.bold_measurement.formula %}
          {% assign bold_qty_class = bold_qty_class | append: ' bold-btm-qty ' %}
          {% assign bold_qty_name = '' %}
          {% assign bold_qty_after = '<input type="hidden" name="updates[]" class="bold-btm-true-qty" value="' | append: bold_item.quantity | append: '">' %}
        {% else %}
          {% assign bold_qty_name = 'updates[]' %}
          {% assign bold_qty_after = '' %}
        {% endif %}
        {% if bold_variant_inventory_policy == 'deny' and bold_item_max_quantity != blank %}
          {% assign bold_qty_attr = bold_qty_attr | append: ' max=' | append: bold_item_max_quantity %}
        {% endif %}
        
        {% comment %} HELPER ATTRIBUTES FOR NON-AJAX +/- BUTTONS {% endcomment %}
        {% assign bold_qty_button_attr = '' %}
        {% assign bold_qty_readonly = false %}
        {% if bold_item.properties[master_builder] != blank %}
          {% assign bold_qty_button_attr = ' onclick="trigger_qty_update()" ' %}
        {% endif %}
        {% if bold_item.product.metafields.inventory.ShappifyHidden == "true" or bold_item.variant.metafields.bold_measurement.formula %}
          {% assign bold_qty_button_attr = bold_qty_button_attr | append: ' disabled="disabled" '%}
          {% assign bold_qty_readonly = true %}
        {% endif %}
        
        {% comment %} GENERATE PROPERTIES DESCRIPTION {% endcomment %}
        {% assign bold_builder_product = false %}
        {% capture bold_item_properties %}
          {% capture custom_properties_display_check %}{% include 'bold-item-properties' with bold_item %}{% endcapture %}
          {% unless custom_properties_display_check contains 'Liquid error' %}
            {{ custom_properties_display_check }}
          {% else %}
        	<div class="bold-properties bold-properties-{{ bold_item.properties[builder_id] }}">
              {% for p in bold_item.properties %}
                  {% assign underscore_hidden = false %}
                  {% assign first_char = p.first | slice: 0 %}
                  {% assign second_char = p.first | slice: 1 %}
                  {% if first_char == "_" and second_char != "_" %}
                      {% assign underscore_hidden = true %}
                  {% endif %}
        
                  {% comment %} CHECK FOR ALL THE REASONS WE MIGHT HIDE THIS PROPERTY FROM THE DISPLAY {% endcomment %}
                  {% if p.first == 'total_recurrences' or p.first == "frequency_type_text" or p.first == "frequency_type" or p.first == "frequency_num" or p.first == "builder_id" or p.first == "builder_info" or p.first == "master_builder" or p.first == "group_id" or p.first == "discounted_price" or p.first == "is_prepaid" or underscore_hidden == true or p.last == blank %}
                    {% if p.first contains "builder_info" %}
                        {% assign bold_builder_product = true %}
                        {% if p.first == 'builder_info' %}
                          {% assign builder_info = 'builder_info' %}
                        {% else %}
                          {% assign builder_info = '_builder_info' %}
                        {% endif %}
                    {% endif %}
                    {% continue %}
                  {% endif %}
                  {% assign option_title = p.first %}
                  <div class='bold_option_line'><span class="bold_option_title">{{ p.first | replace: '__', '' | replace: '&amp;', '&' }}</span><span class="bold_option_seperator">: </span>
        
                  {% comment %} DISPLAY UPLOAD LINKS AS LINKS, EVERYTHING ELSE AS TEXT{% endcomment %}
                  {% if p.last contains '/uploads/' %}
                  	<span class="bold_option_value"><a class="lightbox" href="{{ p.last }}">Uploaded File</a></span>
                  {% else %}
                  	<span class="bold_option_value" >{{ p.last | replace: '&amp;', '&' | replace: '&lt;', '<' | replace: '&gt;', '>'  }}</span>
                  {% endif %}
                  </div>
              {% endfor %}
        	</div>
        	{% if bold_item.properties[builder_id] != blank %}
        		<div id="bold-item-{{ bold_item.properties[builder_id]}}" data-is-builder="{{ bold_builder_product }}" data-handle="{{ bold_item.product.handle }}" data-variant-id="{{ bold_item.variant.id }}" class="bold-edit-item" data-index="{{ forloop.index }}"></div>
        	{% endif %}
          {% endunless %}
        {% endcapture %}
        
        {% comment %} GENERATE RECURRING ORDER VARIABLES FOR CUSTOM DISPLAY {% endcomment %}
        {% assign bold_recurring_frequency_num = bold_item.properties.frequency_num %}
        {% assign bold_recurring_frequency_text = bold_item.properties.frequency_type_text %}
        {% assign bold_recurring_savings = bold_original_price | minus: bold_item_price %}
        
        {% comment %} GENERATE RECURRING ORDER DESCRIPTION {% endcomment %}
        {% assign bold_is_recurring = false %}
        {% capture bold_recurring_desc %}
          {% if bold_item.properties.frequency_type and bold_item.properties.frequency_num and bold_item.properties.frequency_type_text  %}
            {% assign bold_is_recurring = true %}
            {% capture custom_recurring_desc_check %}{% include 'bold-recurring-desc' with bold_item %}{% endcapture %}
            {% unless custom_recurring_desc_check contains 'Liquid error' %}
              {{ custom_recurring_desc_check }}
            {% else %}
        		{% unless bold_item.properties._convertible_discount_percent%}
        			<div class = "bold_recurring_desc">
        				<span class="bold_ro_every">Every </span>
        				<span class="bold_ro_frequency_num">{{ bold_item.properties.frequency_num}} </span>
        				<span class="bold_ro_frequency_type_text">{{ bold_item.properties.frequency_type_text }} </span>
        				{% if bold_item.properties.discounted_price %}<span class="discounted_price_in_cart">{{ bold_item_price | money }}</span><span class="bold_ro_each"> each</span>{% endif %}
        				{% if bold_item.properties._secondary_discount_percent %}
        				  {% assign bold_ro_secondary_discount_multiplier = 100.00 | minus: bold_item.properties._secondary_discount_percent | times: 0.01 %}
        				  {% assign bold_ro_secondary_discount_price = bold_item.price | times: bold_ro_secondary_discount_multiplier %}
        				  <br>
        				  {% if bold_item.properties._secondary_discount_required_orders == '1' %}
        					{% if bold_ro_secondary_discount_price < bold_item.price %}
        						<span class="bold_ro_is_discount">Discounted price </span>
        					{% else %}
        						<span class="bold_ro_no_discount">Price </span>
        					{% endif %}
        					<span class="bold_ro_price_after_first">after first order </span>
        					<span class="bold_ro_secondary_discount_price">{{bold_ro_secondary_discount_price | money}}</span>
        				  {% else %}
        					{% if bold_ro_secondary_discount_price < bold_item.price %}
        						<span class="bold_ro_is_discount">Discounted price </span>
        					{% else %}
        						<span class="bold_ro_no_discount">Price </span>
        					{% endif %}
        					<span class="bold_ro_price_after_multiple">after </span>
        					<span class="bold_ro_secondary_discount_required_orders">{{bold_item.properties._secondary_discount_required_orders}} </span>
        					<span class="bold_ro_secondary_discount_orders">orders: </span>
        					<span class="bold_ro_secondary_discount_price">{{bold_ro_secondary_discount_price | money}}</span>
        				  {% endif %}
        				{% endif %}
        			</div>
        		{% endunless %}
        		{% if bold_item.properties._convertible_discount_percent %}
        			{% assign bold_ro_convertible_multiplier = 100.00 | minus: bold_item.properties._convertible_discount_percent | times: 0.01 %}
        			{% assign bold_ro_convertible_product_price = all_products[bold_item.properties._convertible_product_handle].price %}
        			{% assign bold_ro_convertible_title = all_products[bold_item.properties._convertible_product_handle].title %}
        			{% assign bold_ro_convertible_variant_id = bold_item.properties._convertible_variant_id | times: 1 %}
        			{% for var in all_products[bold_item.properties._convertible_product_handle].variants %}
        			  {% if var.id == bold_ro_convertible_variant_id %}
        				{% assign bold_ro_convertible_product_price = var.price %}
        				{% if var.title != 'Default Title' %}
        					{% assign bold_ro_convertible_title = bold_ro_convertible_title | append: ' - ' | append: var.title %}
        				{% endif %}
        			  {% endif %}
        			{% endfor %}
        			{% assign bold_ro_convertible_discount_price = bold_ro_convertible_product_price | times: bold_ro_convertible_multiplier %}
        			<span class="bold_ro_conversion">Converts to: </span>
        			<span class="bold_ro_convert_initial_product">{{bold_ro_convertible_title}} </span>
        			<span class="converted_discounted_price_in_cart">{{ bold_ro_convertible_discount_price | money }}</span>
        			<br>
        			<span class="bold_ro_deliver_every">Deliver every </span>
        			<span class="bold_ro_frequency_num">{{ bold_item.properties.frequency_num}} </span>
        			<span class="bold_ro_frequency_type_text">{{ bold_item.properties.frequency_type_text }}</span>
        			<br>
        		{% endif%}
        		{% if bold_item.properties.total_recurrences %}
        			<span class="bold_ro_total_recurrences_label">Your subscription will last for {{ bold_item.properties.total_recurrences }} shipments</span>
        		{% endif %}
            {% endunless %}
          {% endif %}
        
          {% comment %} GENERATE HIDDEN INPUT FIELDS FOR RO PRODUCTS {% endcomment %}
          {% if bold_item.properties.frequency_type and bold_item.properties.frequency_num and bold_item.properties.frequency_type_text  %}
        		<input type="hidden" name="{{ forloop.index0 }}[number]" value="{{ bold_item.properties.frequency_num }}" />
        		<input type="hidden" name="{{ forloop.index0 }}[type_id]" value="{{ bold_item.properties.frequency_type }}" />
          {% endif %}
        
          {% comment %} GENERATE REMAINING HIDDEN INPUT FIELDS FOR ALL ITEMS {% endcomment %}
            <input type="hidden" name="product_id[{{ forloop.index0 }}]" value="{{ bold_item.product.id }}">
            <input type="hidden" name="variant_id[{{ forloop.index0 }}]" value="{{ bold_item.variant.id }}">
            <input type="hidden" name="quantity[{{ forloop.index0 }}]" value="{{ bold_item.quantity }}">
        {% endcapture %}
        
        {% comment %} EXPOSE DATA FOR RO CONVERTIBLE ITEM {% endcomment %}
        {% if bold_item.properties._convertible_product_handle != blank %}
            <script>
                BOLD = BOLD || {};
                BOLD.recurring_orders = BOLD.recurring_orders || {};
                BOLD.recurring_orders.convertible_products = BOLD.recurring_orders.convertible_products || {};
                BOLD.recurring_orders.convertible_products['{{bold_item.properties._convertible_product_handle}}'] = {{ all_products[bold_item.properties._convertible_product_handle] | json }};
            </script>
        {% endif %}
        
        {% comment %} GENERATE BOLD DESCRIPTION {% endcomment %}
        {% capture bold_desc %}
            <span class="bold-cart-item" data-product-id="{{bold_item.id}}-{{forloop.index0}}"></span>
        {% endcapture %}
        
        {% comment %} GENERATE VARIABLES FOR BUILDER {% endcomment %}
        {% if bold_builder_product %}
          {% assign builder_info = bold_item.properties[builder_info] | split: '~~' %}
          {% assign bold_builder_img_alt = builder_info[0] %}
          {% assign bold_builder_img_src = builder_info[1] %}
          {% assign bold_builder_href = '/apps/productbuilder/' | append: builder_info[2] %}
        {% else %}
          {% assign bold_builder_img_alt = false %}
          {% assign bold_builder_img_src = false %}
          {% assign bold_builder_href = bold_item.product.url %}
        {% endif %}
        
        {% comment %} ALIASES FOR PRODUCT OPTIONS VARIABLES FOR QUICK-INSTALL {% endcomment %}
        {% assign boldoptions_step3 = bold_row_class %}
        {% assign boldoptions_step4 = bold_row_data %}
        {% assign boldoptions_step6 = bold_item_properties %}
        {% assign boldoptions_step7 = bold_qty_class %}
        {% assign boldoptions_step8 = bold_qty_attr %}
        {% assign boldoptions_step9 = bold_remove_href %}
        {% assign boldoptions_step10 = bold_remove_class %}
        {% assign boldoptions_step11 = bold_remove_attr %}
        {% assign boldoptions_step12 = bold_item_price | money %}
        {% assign boldoptions_step13 = bold_item_line_price | money %}
        
        {% endcapture %}{{ bold_cart_item_liquid | strip_newlines }}
      3. {%- comment -%}
        BOLD-COMMON.LIQUID
        Last updated: 2018-Aug-9
        
        ---------------------------  WARNING  ---------------------------
        This file is auto-generated by BOLD and should not be modified.
        It may be overwritten and any customizations would be lost.
        ---------------------------  WARNING  ---------------------------
        {%- endcomment -%}
        <script>
           {%- comment -%} common data {%- endcomment -%}
           window.BOLD = window.BOLD || {};
           window.BOLD.common = window.BOLD.common || {};
           window.BOLD.common.Shopify = window.BOLD.common.Shopify || {};
           window.BOLD.common.Shopify.shop = {
             domain: '{{ shop.domain }}',
             permanent_domain: '{{ shop.permanent_domain }}',
             url: '{{ shop.url }}',
             secure_url: '{{ shop.secure_url }}',
             money_format: {{ shop.money_format | json }},
             currency: {{ shop.currency | json }}
           };
           window.BOLD.common.Shopify.customer = {
             id: {{ customer.id | json }},
             tags: {{ customer.tags | json }},
           };
           window.BOLD.common.Shopify.cart = {{ cart | json }};
           window.BOLD.common.template = '{{ template | split: "." | first }}';
           {%- comment -%} common functions {%- endcomment -%}
           window.BOLD.common.Shopify.formatMoney = function(money, format) {
               function n(t, e) {
                   return "undefined" == typeof t ? e : t
               }
               function r(t, e, r, i) {
                   if (e = n(e, 2),
                       r = n(r, ","),
                       i = n(i, "."),
                   isNaN(t) || null == t)
                       return 0;
                   t = (t / 100).toFixed(e);
                   var o = t.split(".")
                       , a = o[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + r)
                       , s = o[1] ? i + o[1] : "";
                   return a + s
               }
               "string" == typeof money && (money = money.replace(".", ""));
               var i = ""
                   , o = /\{\{\s*(\w+)\s*\}\}/
                   , a = format || window.BOLD.common.Shopify.shop.money_format || window.Shopify.money_format || "$ {% raw %}{{ amount }}{% endraw %}";
               switch (a.match(o)[1]) {
                   case "amount":
                       i = r(money, 2, ",", ".");
                       break;
                   case "amount_no_decimals":
                       i = r(money, 0, ",", ".");
                       break;
                   case "amount_with_comma_separator":
                       i = r(money, 2, ".", ",");
                       break;
                   case "amount_no_decimals_with_comma_separator":
                       i = r(money, 0, ".", ",");
                       break;
                   case "amount_with_space_separator":
                       i = r(money, 2, " ", ",");
                       break;
                   case "amount_no_decimals_with_space_separator":
                       i = r(money, 0, " ", ",");
                       break;
                   case "amount_with_apostrophe_separator":
                       i = r(money, 2, "'", ".");
                       break;
               }
               return a.replace(o, i);
           };
           window.BOLD.common.Shopify.saveProduct = function (handle, product) {
             if (typeof handle === 'string' && typeof window.BOLD.common.Shopify.products[handle] === 'undefined') {
               if (typeof product === 'number') {
                 window.BOLD.common.Shopify.handles[product] = handle;
                 product = { id: product };
               }
               window.BOLD.common.Shopify.products[handle] = product;
             }
           };
           window.BOLD.common.Shopify.saveVariant = function (variant_id, variant) {
             if (typeof variant_id === 'number' && typeof window.BOLD.common.Shopify.variants[variant_id] === 'undefined') {
               window.BOLD.common.Shopify.variants[variant_id] = variant;
             }
           };
           {%- comment -%} product data {%- endcomment -%}
           window.BOLD.common.Shopify.products = window.BOLD.common.Shopify.products || {};
           window.BOLD.common.Shopify.variants = window.BOLD.common.Shopify.variants || {};
           window.BOLD.common.Shopify.handles = window.BOLD.common.Shopify.handles || {};
           {%- if template == 'product' -%}
           window.BOLD.common.Shopify.handle = {{ product.handle | json }}
           {%- endif -%}
           {%- comment -%} product page {%- endcomment -%}
           window.BOLD.common.Shopify.saveProduct({{ product.handle | json }}, {{ product.id | json }});
           {%- for variant in product.variants -%}{%- assign csp_metafield_namespace = variant.id | prepend: "csp" -%}window.BOLD.common.Shopify.saveVariant({{ variant.id | json }}, { product_id: {{ product.id | json }}, product_handle: {{ product.handle | json }}, price: {{ variant.price | json }}, group_id: '{{variant.metafields.bold_rp.rp_group_id}}', csp_metafield: {{ product.metafields[csp_metafield_namespace] | json }}});{%- endfor -%}
        
           {%- comment -%} BOLD APPS INSTALLED {%- endcomment -%}
           {%- assign bold_apps_installed = shop | map: 'metafields' | map: 'bold_apps_installed' | first -%}
           window.BOLD.apps_installed = {{ bold_apps_installed | json }} || {};
        
           {%- unless bold_apps_installed contains 'Customer Pricing' or bold_apps_installed contains 'Product Bundles' or bold_apps_installed contains 'Product Discount' or bold_apps_installed contains 'Quantity Breaks' or bold_apps_installed contains 'Custom Order' or bold_apps_installed contains 'Order Manager' or bold_apps_installed contains 'The Motivator'-%}
               {%- comment -%} collection page {%- endcomment -%}
               {%- for product in collection.products -%}
                   window.BOLD.common.Shopify.saveProduct({{ product.handle | json }}, {{ product.id | json }});
                   {%- for variant in product.variants -%}{%- assign csp_metafield_namespace = variant.id | prepend: "csp" -%}window.BOLD.common.Shopify.saveVariant({{ variant.id | json }}, { product_id: {{ product.id | json }}, product_handle: {{ product.handle | json }}, price: {{ variant.price | json }}, group_id: '{{variant.metafields.bold_rp.rp_group_id}}', csp_metafield: {{ product.metafields[csp_metafield_namespace] | json }}});{%- endfor -%}
               {%- endfor -%}
               {%- comment -%} search page {%- endcomment -%}
               {%- for product in search.results -%}
                   window.BOLD.common.Shopify.saveProduct({{ product.handle | json }}, {{ product.id | json }});
                   {%- for variant in product.variants -%}{%- assign csp_metafield_namespace = variant.id | prepend: "csp" -%}window.BOLD.common.Shopify.saveVariant({{ variant.id | json }}, { product_id: {{ product.id | json }}, product_handle: {{ product.handle | json }}, price: {{ variant.price | json }}, group_id: '{{variant.metafields.bold_rp.rp_group_id}}', csp_metafield: {{ product.metafields[csp_metafield_namespace] | json }}});{%- endfor -%}
               {%- endfor -%}
           {%- endunless -%}
        
           {%- comment -%} cart page {%- endcomment -%}
           {%- for item in cart.items -%}{%- assign csp_metafield_namespace = item.variant_id | prepend: "csp" -%}window.BOLD.common.Shopify.saveVariant({{ item.variant_id | json }}, { product_id: {{ item.product.id | json }}, product_handle: {{ item.product.handle | json }}, price: {{ item.variant.price | json }}, group_id: '{{item.variant.metafields.bold_rp.rp_group_id}}', csp_metafield: {{ item.product.metafields[csp_metafield_namespace] | json }}});{%- endfor -%}
           {%- comment -%} metafields {%- endcomment -%}
           window.BOLD.common.Shopify.metafields = window.BOLD.common.Shopify.metafields || {};
           {%- assign metafield_namespaces_to_load = 'bold_rp,bold_csp_defaults' | split: ',' -%}
           {%- for namespace in metafield_namespaces_to_load -%}
               window.BOLD.common.Shopify.metafields[{{ namespace | json }}] = {{ shop.metafields[namespace] | json }};
           {%- endfor -%}
           window.BOLD.common.cacheParams = window.BOLD.common.cacheParams || {};
        </script>
        
        {%- comment -%} INCLUDE APP SCRIPTS BELOW {%- endcomment -%}
      4. {%- comment -%}
        BOLD-INCLUDES.LIQUID
        
        ---------------------------  WARNING  ---------------------------
        THIS IS A GENERATED ASSET OF INCLUDES FOR INSTALLED BOL APPLICATIONS SO NOT MODIFY
        ---------------------------  WARNING  ---------------------------
        {%- endcomment -%}
      5. {%- comment -%}
        
        BOLD-CSP-METAFIELD-VARIANT.LIQUID
        Last updated: 2018-July-31
        
        NOTE: Tag matching between customer tags and the shop metafield is case INSENSITIVE
        
        FLAGS:
          base_product:      {product object}                          Base product object for the variant, used to check/set several properties. If not supplied, defaults to bold_product. If no bold_product is set, defaults to product
          hide_action:       'skip' | 'none'  (default)                Forces a 'continue' to skip hidden variants when 'skip' is set
          customer_tag:      {string} | null (default)                 If set, forces bold-variant to calculate as though the customer had the specified tag
        
        {%- endcomment -%}
        
        {%- comment -%}
        ============================================================================================================
            ASSIGN LIQUID VARIABLES
        ============================================================================================================
        {%- endcomment -%}
        
        {%- assign bold_csp_variant = bold-csp-metafield-variant | default: bold_variant | default: variant | default: item.variant -%}
        {%- assign bold_csp_variant_base_product = base_product | default: bold_product | default: product | default: item.product | default: item -%}
        {%- assign bold_csp_customer_tag = customer_tag | default: csp_customer_tag -%}
        {%- assign bold_csp_variant_id = bold_csp_variant.id -%}
        
        {%- unless bold_csp_customer_tag -%}
          {%- assign bold_csp_customer_tag = 'default' -%}
          {%- if customer.tags and shop.metafields.shop_csp_tag_group.shop_csp_tag -%}
            {%- assign all_shop_tags = shop.metafields.shop_csp_tag_group.shop_csp_tag | append: ',default' | split: ',' -%}
            {%- assign customer_tags = customer.tags | join: ',' | split: ',' -%}
            {%- for customer_tag in customer_tags -%}
              {%- if all_shop_tags contains customer_tag -%}
                {%- assign bold_csp_customer_tag = customer_tag -%}
              {%- endif -%}
            {%- endfor -%}
          {%- endif -%}
          {%- unless customer_tag -%}
            {%- assign csp_customer_tag = bold_csp_customer_tag -%}
          {%- endunless -%}
        {%- endunless -%}
        
        {%- assign csp_metafield_namespace = 'csp' | append: bold_csp_variant_id -%}
        {%- assign csp_metafield_key_single = bold_csp_customer_tag | append: '~' | append: '1' -%}
        {%- assign metafield_data_single = bold_csp_variant_base_product.metafields[csp_metafield_namespace][csp_metafield_key_single] | split: ',' -%}
        
        {%- assign tag_default_discount = shop.metafields.bold_csp_defaults[bold_csp_customer_tag] -%}
        
        {%- comment -%} Fall back to logged-out (default) discount {%- endcomment -%}
        {%- if metafield_data_single == blank and tag_default_discount == blank -%}
          {%- assign csp_customer_tag = 'default' -%}
          {%- assign metafield_data_single = bold_csp_variant_base_product.metafields[csp_metafield_namespace]['default~1'] | split: ',' -%}
        {%- endif -%}
        
        {%- assign across_variants_mode = metafield_data_single[5] | default: '0' -%}
        
        {%- assign item_qty = line_item.quantity | default: 1 -%}
        {%- if line_item != blank -%}
          {%- assign current_product_total = 0 -%}
          {%- for inner_item in cart.items -%}
            {%- if across_variants_mode == '0' and line_item.id == inner_item.id -%}
              {%- comment -%} Use the variant qty to find discounts {%- endcomment -%}
              {%- assign current_product_total = current_product_total | plus: inner_item.quantity -%}
            {%- elsif across_variants_mode == '1' and line_item.product_id == inner_item.product_id -%}
              {%- comment -%} Use the product qty to find discounts {%- endcomment -%}
              {%- assign current_product_total = current_product_total | plus: inner_item.quantity -%}
            {%- endif -%}
          {%- endfor -%}
          {%- assign item_qty = current_product_total -%}
        {%- endif -%}
        
        {%- for qty in (1..item_qty) reversed -%}
          {%- assign csp_metafield_key = bold_csp_customer_tag | append: '~' | append: qty -%}
          {%- assign metafield_data = bold_csp_variant_base_product.metafields[csp_metafield_namespace][csp_metafield_key] | split: ',' -%}
          {%- if metafield_data != blank -%}
            {%- break -%}
          {%- endif -%}
        {%- endfor -%}
        
        {%- if metafield_data != blank -%}
        
          {%- assign price_type = metafield_data[0] -%}
          {%- assign discount_value = metafield_data[1] | times: 1 -%}
          {%- assign cents = metafield_data[2] -%}
          {%- assign taxable = metafield_data[3] -%}
          {%- assign use_discount_compare_at = metafield_data[4] -%}
        
          {%- if use_discount_compare_at == '1' and bold_csp_variant.compare_at_price > 0 -%}
            {%- assign new_price = bold_csp_variant.compare_at_price -%}
          {%- else -%}
            {%- assign new_price = bold_variant_price | default: bold_csp_variant.price -%}
          {%- endif -%}
        
          {%- case price_type -%}
            {%- when '%' -%}
              {%- assign new_price = new_price | times: discount_value | round -%}
            {%- when '$' -%}
              {%- assign new_price = discount_value | times: 100 | round -%}
            {%- when '-' -%}
              {%- assign discount_value = discount_value | times: 100 | round -%}
              {%- assign new_price = new_price | minus: discount_value | round -%}
          {%- endcase -%}
        
          {%- if new_price < 0 -%}
            {%- assign new_price = bold_variant_price | default: bold_csp_variant.price -%}
          {%- endif -%}
        
          {%- if cents != '' and cents != null -%}
            {%- assign vanity_price = new_price | times: 0.01 | floor | times: 100 | plus: cents -%}
            {%- assign new_price = vanity_price -%}
          {%- endif -%}
        
          {%- if new_price < bold_csp_variant.price -%}
          	{%- assign bold_variant_price = new_price -%}
          {%- endif -%}
        
          {%- if taxable == '1' -%}
            {%- assign bold_variant_taxable = true -%}
          {%- else -%}
            {%- assign bold_variant_taxable = false -%}
          {%- endif -%}
        
        {%- else -%}
          {%- comment -%} APPLY TAG DEFAULT DISCOUNT {%- endcomment -%}
          {%- if tag_default_discount != blank -%}
            {%- assign new_price = bold_variant_price | default: bold_csp_variant.price -%}
            {%- assign bold_variant_price = new_price | times: tag_default_discount | round -%}
          {%- endif -%}
        {%- endif -%}
        
      6. {%- comment -%}
        BOLD-PRODUCT.LIQUID
        Last updated: 2018-Oct-16
         
        Sets all the appropriate liquid variables for Bold Apps that affect the product.
        Creates an updated JSON object that takes all appropriate apps into account. Can mimic all three types of product objects that Shopify uses.
        When installing, use {%- include 'bold-product', output: 'json' -%} to replace {{ product | json }} in the theme's liquid code.
        Alternatively, use {%- include 'bold-product', output: 'json', escape: true -%} to replace {{ product | json | escape }} in the theme's liquid code.
         
        FLAGS:
        output:              'none' | 'default' | 'script' | 'json'                   Controls how much data is printed
        endpoint:            'js' | 'json' | false (default)                          Prints 'layout none' to create an AJAX endpoint. Resulting object will be formatted to match either the '.js' or '.json' style of output. If set to a truth-y value other than 'json' will act like a '.js' endpoint.
        hide_action:         'header' | 'error' | 'break' | 'skip' | 'none' (default) Determines what happens if the product is hidden
        sort_by:             {string} | null (default)                                If set, attempts to sort variants by the provided field
        sort_order:          'desc' | 'asc' (default)                                 If set to 'desc' (descending), reverses the variant sort
        customer_tag:        {string} | null (default)                                If set, forces bold-product to calculate as though the customer had the specified tag
        quick_price:         true | false (default)                                   If true, uses the metafields set by the CSP/QB apps to get the prices. Output must be 'none' to be allowed
        additional_includes: {string} | null (default)                                If set, includes the additional products after setting the initial bold_product liquid variables
        variant_includes:    {string} | null (default)                                Additional include files to be passed on to bold-variant (comma-delimited)
        escape:              {bool} | false (default)                                 If set, forces bold-product to escape its json output
         
        REQUIRED: bold-variant.liquid is needed for full product handling.
         
        OPTIONAL: bold-product-error.liquid - If this snippet exists, it will be used to display content other than 'Product not available'
        to the customer if the hide_action is either 'break' or 'error'.
        A bold-product-error snippet can access:
        product: The liquid variable representing the product that is hidden
        reason:  Why the product is hidden. Possible values are:
        'customer-hide-tag' | 'motivator-hidden-product' | 'options-hidden-product' | 'duplicate-and-hide' | 'other'
        {%- endcomment -%}
         
        {%- comment -%}
        ============================================================================================================
        ASSIGN LIQUID VARIABLES
        ============================================================================================================
        {%- endcomment -%}
         
        {%- assign bold_product = bold-product | default: product -%}
        {%- assign bold_price = bold_product.price -%}
        {%- assign bold_price_min = bold_product.price_min -%}
        {%- assign bold_price_max = bold_product.price_max -%}
        {%- assign bold_price_varies = bold_product.price_varies -%}
        {%- assign bold_compare_at_price = bold_product.compare_at_price -%}
        {%- assign bold_compare_at_price_min = bold_product.compare_at_price_min -%}
        {%- assign bold_compare_at_price_max = bold_product.compare_at_price_max -%}
        {%- assign bold_compare_at_price_varies = bold_product.compare_at_price_varies -%}
        {%- assign bold_selected_or_first_available_variant = bold_product.selected_or_first_available_variant | default: bold_product.variants.first | default: bold_product.variants[0] -%}
         
        {%- if product or bold-product -%}
            {%- assign bold_apps_installed = shop | map: 'metafields' | map: 'bold_apps_installed' | first -%}
         
            {%- comment -%}Assign flags to their default values if not set {%- endcomment -%}
            {%- assign escape_output = escape | default: false -%}
            {%- assign bold_product_output = output | default: 'default' -%}
            {%- assign bold_product_endpoint = endpoint | default: false -%}
            {%- if bold_product_endpoint -%}{%- assign bold_product_output = 'json' -%}{%- endif -%}
         
            {%- assign bold_product_hide_action = hide_action | default: 'none' -%}
            {%- assign bold_product_sort_by = sort_by | default: nil -%}
            {%- assign bold_product_sort_order = sort_order | default: 'asc' -%}
            {%- assign bold_product_quick_price = quick_price | default: false -%}
         
            {%- if bold_product_hide_action == 'skip' and output == blank -%}
                {%- assign product_metafield_check = bold_product.variants | map: 'metafields' | map: 'shappify_csp' | map: 'csp_tag' | uniq -%}
                {%- if product_metafield_check.size > 1 or product_metafield_check.first != blank -%}
                    {%- assign has_csp = true -%}
                {%- else -%}
                    {%- assign has_csp = false -%}
                {%- endif -%}
                {%- if quick_price == blank and shop.metafields.shop_csp_tag_group.shop_csp_tag and has_csp -%}
                    {%- assign bold_product_quick_price = true -%}
                {%- endif -%}
            {%- endif -%}
         
            {%- if bold_apps_installed contains 'Quantity Breaks' or bold_apps_installed contains 'Customer Pricing' or bold_apps_installed contains 'Product Bundles' or bold_apps_installed contains 'The Motivator' -%}
                {%- unless csp_customer_tag -%}
                    {%- if customer.tags and shop.metafields.shop_csp_tag_group.shop_csp_tag -%}
                        {%- assign all_shop_tags = shop.metafields.shop_csp_tag_group.shop_csp_tag | append: ',default' | split: ',' -%}
                        {%- for customer_tag in customer.tags -%}
                            {%- if all_shop_tags contains customer_tag -%}
                                {%- assign csp_customer_tag = customer_tag -%}
                            {%- endif -%}
                        {%- endfor -%}
                    {%- endif -%}
                    {%- assign bold_product_customer_tag = customer_tag | default: csp_customer_tag | default: 'default' -%}
                {%- endunless -%}
         
                {%- if bold_product_output == 'json' and bold_product_endpoint -%}{%- layout none -%}{%- endif -%}
         
                {%- assign variant_list = bold_product.variants -%}
                {%- if bold_product_sort_by != blank -%}{%- assign variant_list = variant_list | sort: bold_product_sort_by -%}{%- endif -%}
                {%- if bold_product_sort_order == 'desc' or bold_product_sort_order == 'descending' -%}{%- assign variant_list = variant_list | reverse -%}{%- endif -%}
                {%- assign variant_list = variant_list | default: bold_product.variants -%}
         
                {%- if bold_product_output == 'json' -%}
                    {%- assign requires_variant_loop = true -%}
                    {%- elsif bold_product_quick_price and bold_product_output == 'none' -%}
                    {%- assign requires_variant_loop = false -%}
                {%- else -%}
                    {%- assign requires_variant_loop = bold_product.metafields.shappify_bundle | default: bold_product.metafields.shappify_csp | default: bold_product.metafields.shappify_qb | default: shop.metafields.shop_csp_tag_group | default: shop.metafields.bold_measurement | default: shop.metafields.bold_rp | default: false -%}
                {%- endif -%}
         
                {%- capture bold_bundles_widget -%}
                    <div class="bold-bundle" data-product-id="{{ product.id }}"></div>
                {%- endcapture -%}
         
                {%- assign product_has_btm = false -%}
                {%- assign product_has_csp = false -%}
                {%- assign product_has_qb = false -%}
                {%- assign product_has_ro = false -%}
                {%- assign product_has_bdl = false -%}
         
                {%- assign bold_hidden_product = false -%}
                {%- assign bold_trigger_break = false -%}
         
                {%- if requires_variant_loop -%}
                    {%- comment -%}INTIALIZE VARIABLES, CLEAR OLD VALUES {%- endcomment -%}
                    {%- assign bold_price_min = 1000000000000000000 -%}               {%- comment -%}Starting the count at Shopify's max allowed value {%- endcomment -%}
                    {%- assign bold_price_max = 0 -%}
                    {%- assign bold_price = bold_price_min -%}
                    {%- assign bold_price_varies = false -%}
         
                    {%- assign bold_compare_at_price_min = 1000000000000000000  -%}   {%- comment -%}Starting the count at Shopify's max allowed value {%- endcomment -%}
                    {%- assign bold_compare_at_price_max = 0 -%}
                    {%- assign bold_compare_at_price = bold_compare_at_price_min -%}
                    {%- assign bold_compare_at_price_varies = false -%}
         
                    {%- assign bold_selected_or_first_available_variant = "" -%}
                    {%- assign bold_variants_size = 0 -%}
         
                    {%- assign options1 = nil -%}
                    {%- assign options2 = nil -%}
                    {%- assign options3 = nil -%}
         
                    {%- assign bold_product_available = false -%}
         
                    {%- comment -%}SET LIQUID PRODUCT VARIABLES DERIVED FROM VARIANT VALUES {%- endcomment -%}
         
                    {%- assign variant_output_json = '' -%}
                    {%- for variant in variant_list -%}
                        {%- capture bold_variant_check -%}
                            {%- include 'bold-variant' with variant, output: 'json', hide_action: 'skip', base_product: bold_product, customer_tag: bold_product_customer_tag, price_style: bold_product_endpoint -%}
                        {%- endcapture -%}
         
                        {%- unless bold_product_output == 'none' -%}
                            {%- if bold_variant_check contains 'Liquid error' -%}
                                {%- assign variant_output_json = variant_list | json -%}
                                {%- break -%}
                            {%- endif -%}
                        {%- endunless -%}
         
                        {%- if variant_output_json.size > 1 -%}{%- assign variant_output_json = variant_output_json | append: ',' -%}{%- endif -%}
                        {%- assign variant_output_json = variant_output_json | append: bold_variant_check -%}
         
                        {%- if bold_variant_price < bold_price_min -%}{%- assign bold_price_min = bold_variant_price -%}{%- endif -%}
                        {%- if bold_variant_price > bold_price_max -%}{%- assign bold_price_max = bold_variant_price -%}{%- endif -%}
                        {%- if bold_price_max != bold_price_min -%}{%- assign bold_price_varies = true -%}{%- endif -%}
                        {%- assign bold_price = bold_price_min -%}
         
                        {%- if variant.compare_at_price < bold_compare_at_price_min -%}{%- assign bold_compare_at_price_min = variant.compare_at_price -%}{%- endif -%}
                        {%- if variant.compare_at_price > bold_compare_at_price_max -%}{%- assign bold_compare_at_price_max = variant.compare_at_price -%}{%- endif -%}
                        {%- if bold_compare_at_price_max != bold_compare_at_price_min -%}{%- assign bold_compare_at_price_varies = true -%}{%- endif -%}
                        {%- assign bold_compare_at_price = bold_compare_at_price_min -%}
         
                        {%- if variant.id == bold_product.selected_or_first_available_variant.id -%}{%- assign bold_selected_or_first_available_variant = variant -%}{%- endif -%}
                        {%- if bold_selected_or_first_available_variant == "" -%}{%- assign bold_selected_or_first_available_variant = variant -%}{%- endif -%}
                        {%- if bold_selected_or_first_available_variant.available == false and variant.available == true -%}{%- assign bold_selected_or_first_available_variant = variant -%}{%- endif -%}
                        {%- assign bold_variants_size = bold_variants_size | plus: 1 -%}
         
                        {%- unless options1 contains option1_clean_name or option1_clean_name == blank -%}
                        {%- unless options1 == blank -%}{%- assign options1 = options1 | join: '~~' | append: '~~' -%}{%- endunless -%}
                        {%- assign options1 = options1 | append: option1_clean_name | split: '~~' -%}
                        {%- endunless -%}
         
                        {%- unless options2 contains option2_clean_name or option2_clean_name == blank -%}
                        {%- unless options2 == blank -%}{%- assign options2 = options2 | join: '~~' | append: '~~' -%}{%- endunless -%}
                        {%- assign options2 = options2 | append: option2_clean_name | split: '~~' -%}
                        {%- endunless -%}
         
                        {%- unless options3 contains option3_clean_name or option3_clean_name == blank -%}
                        {%- unless options3 == blank -%}{%- assign options3 = options3 | join: '~~' | append: '~~' -%}{%- endunless -%}
                        {%- assign options3 = options3 | append: option3_clean_name | split: '~~' -%}
                        {%- endunless -%}
         
                        {%- assign bold_product_available = bold_product_available | default: bold_variant_available -%}
                        {%- assign product_has_btm = variant_has_btm | default: product_has_btm -%}
                        {%- assign product_has_csp = variant_has_csp | default: product_has_csp -%}
                        {%- assign product_has_qb = variant_has_qb | default: product_has_qb -%}
                        {%- assign product_has_ro = variant_has_ro | default: product_has_ro -%}
                        {%- assign product_has_bdl = variant_has_bdl | default: product_has_bdl -%}
         
                    {%- endfor -%}
         
                    {%- if variant_output_json.first != '[' -%}
                        {%- assign variant_output_json = '[' | append: variant_output_json | append: ']' -%}
                    {%- endif -%}
         
                    {%- comment -%}Failsafe: This will set all the Bold prices to "NaN" (Not A Number) in the unexpected case where all variants are supposed to be hidden from the customer {%- endcomment -%}
                    {%- if bold_variants_size == 0 -%}{%- assign bold_price_min = "NaN" -%}{%- assign bold_price_max = "NaN" -%}{%- assign bold_price = "NaN" -%}{%- assign bold_compare_at_price_min = "NaN" -%}{%- assign bold_compare_at_price_max = "NaN" -%}{%- assign bold_compare_at_price = "NaN" -%}{%- endif -%}
         
                    {%- comment -%}Failsafe: This will set all the Bold compare_at prices to the default compare_at_prices when 'compare_at' is not found {%- endcomment -%}
                    {%- if bold_compare_at_price_min > bold_compare_at_price_max -%}{%- assign bold_compare_at_price_min = bold_product.compare_at_price_min -%}{%- assign bold_compare_at_price_max = bold_product.compare_at_price_max -%}{%- assign bold_compare_at_price = bold_product.compare_at_price -%}{%- endif -%}
         
                    {%- comment -%}Failsafe: If no valid variants exist, fail back to product.selected_or_first_available_variant after all {%- endcomment -%}
                    {%- if bold_selected_or_first_available_variant == "" -%}{%- assign bold_selected_or_first_available_variant = product.selected_or_first_available_variant -%}{%- endif -%}
         
                {%- else -%}
         
                    {%- if bold_product_quick_price -%}
                        {%- assign money_prefix = shop.money_format | split: '{{' | first -%}
                        {%- assign money_suffix = shop.money_format | split: '}}' | last -%}
                        {%- assign high_tag = bold_product_customer_tag | append: '_price_high' -%}
                        {%- assign bold_price_min = bold_product.metafields.shappify_csp[bold_product_customer_tag] | default: bold_product.metafields.shappify_qb.qb_min | default: bold_product.price | remove: money_prefix | remove: money_suffix | remove: '.' | remove: ',' | remove: ' ' | times: 1 -%}
                        {%- assign bold_price_max = bold_product.metafields.shappify_csp[high_tag] | default: bold_product.price_max  | remove: money_prefix | remove: money_suffix | remove: '.' | remove: ',' | remove: ' ' | times: 1 -%}
                        {%- assign bold_price = bold_price_min -%}
                        {%- if bold_price_max == bold_price_min -%}
                            {%- assign bold_price_varies = false -%}
                        {%- else -%}
                            {%- assign bold_price_varies = true -%}
                        {%- endif -%}
                    {%- else -%}
                        {%- assign bold_price_min = bold_product.price_min -%}
                        {%- assign bold_price_max = bold_product.price_max -%}
                        {%- assign bold_price = bold_product.price -%}
                        {%- assign bold_price_varies = bold_product.price_varies -%}
                    {%- endif -%}
         
         
                    {%- assign bold_compare_at_price_min = bold_product.compare_at_price_min  -%}
                    {%- assign bold_compare_at_price_max = bold_product.compare_at_price_max -%}
                    {%- assign bold_compare_at_price = bold_product.compare_at_price -%}
                    {%- assign bold_compare_at_price_varies = bold_product.compare_at_price_varies -%}
         
                    {%- assign bold_selected_or_first_available_variant = bold_product.selected_or_first_available_variant -%}
                    {%- assign bold_variants_size = bold_product.variants.size -%}
         
                    {%- assign options1 = bold_product.options[0].values -%}
                    {%- assign options2 = bold_product.options[1].values -%}
                    {%- assign options3 = bold_product.options[2].values -%}
         
                    {%- assign bold_product_available = false -%}
                    {%- assign variant_output_json = variant_list | json -%}
                {%- endif -%}
         
                {%- if bold_product_endpoint == 'json' -%}
                    {%- assign cents = bold_price | modulo: 100 | prepend: '00' | slice: -2, 2 -%}
                    {%- assign dollars = bold_price | times: 0.01 | floor -%}
                    {%- assign bold_price = dollars | append: '.' | append: cents -%}
         
                    {%- assign cents = bold_price_min | modulo: 100 | prepend: '00' | slice: -2, 2 -%}
                    {%- assign dollars = bold_price_min | times: 0.01 | floor -%}
                    {%- assign bold_price_min = dollars | append: '.' | append: cents -%}
         
                    {%- assign cents = bold_price_max | modulo: 100 | prepend: '00' | slice: -2, 2 -%}
                    {%- assign dollars = bold_price_max | times: 0.01 | floor -%}
                    {%- assign bold_price_max = dollars | append: '.' | append: cents -%}
         
                    {%- assign cents = bold_compare_at_price | modulo: 100 | prepend: '00' | slice: -2, 2 -%}
                    {%- assign dollars = bold_compare_at_price | times: 0.01 | floor -%}
                    {%- assign bold_compare_at_price = dollars | append: '.' | append: cents -%}
         
                    {%- assign cents = bold_compare_at_price_min | modulo: 100 | prepend: '00' | slice: -2, 2 -%}
                    {%- assign dollars = bold_compare_at_price_min | times: 0.01 | floor -%}
                    {%- assign bold_compare_at_price_min = dollars | append: '.' | append: cents -%}
         
                    {%- assign cents = bold_compare_at_price_max | modulo: 100 | prepend: '00' | slice: -2, 2 -%}
                    {%- assign dollars = bold_compare_at_price_max | times: 0.01 | floor -%}
                    {%- assign bold_compare_at_price_max = dollars | append: '.' | append: cents -%}
                {%- endif -%}
         
            {%- endif -%}
         
            {%- comment -%}
            ============================================================================================================
            HANDLE HIDDEN PRODUCTS
            ============================================================================================================
            {%- endcomment -%}
         
            {%- comment -%}CHECK FOR CSP VISIBILITY {%- endcomment -%}
            {%- assign csp_hide_tag = false -%}
            {%- assign hide_check = bold_product_customer_tag | append: '-HIDE' -%}
            {%- if bold_product.tags contains hide_check -%}{%- assign csp_hide_tag = true -%}{%- endif -%}
            {%- comment -%}END OF CSP CHECK {%- endcomment -%}
         
            {%- unless bold_product.id == blank -%}
                {%- if csp_hide_tag == true or bold_product.type == 'OPTIONS_HIDDEN_PRODUCT' or bold_product.type == 'MOTIVATOR_HIDDEN_PRODUCT' or bold_product.metafields.inventory.ShappifyHidden == "true" -%}
                    {%- assign bold_hidden_product = true -%}
         
                    {%- comment -%}What is the reason for the hidden product? {%- endcomment -%}
                    {%- if csp_hide_tag == true -%}                                          {%- assign reason = 'customer-hide-tag' -%}
                        {%- elsif bold_product.type == 'MOTIVATOR_HIDDEN_PRODUCT' -%}            {%- assign reason = 'motivator-hidden-product' -%}
                        {%- elsif bold_product.type == 'OPTIONS_HIDDEN_PRODUCT' -%}              {%- assign reason = 'options-hidden-product' -%}
                        {%- elsif bold_product.metafields.inventory.ShappifyHidden == "true" -%} {%- assign reason = 'duplicate-and-hide' -%}
                    {%- else -%}                                                             {%- assign reason = 'other' -%}
                    {%- endif -%}
         
                    {%- capture hidden_product_output -%}
                    {%- case bold_product_hide_action -%}
                    {%- when 'break' -%}
                    {%- capture error_page_check -%}{%- include 'bold-product-error' with reason, product: bold_product -%}{%- endcapture -%}
                    {%- unless error_page_check contains 'Liquid error' -%}
                    {{- error_page_check -}}
                {%- else -%}
                    <p class='bold_not_available'>Product is not available</p>
                    {%- endunless -%}
                    {%- assign bold_trigger_break = true -%}
         
                    {%- when 'error' -%}
                    {%- include 'bold-product-error' with reason, product: bold_product -%}
                    {%- assign bold_trigger_break = true -%}
         
                    {%- when 'skip' -%}
                    {%- continue -%}
         
                    {%- when 'header' -%}
                    {%- if template == 'product' -%}<meta name="robots" content="noindex">{%- endif -%}
                    {%- endcase -%}
                    {%- endcapture%}
                {%- endif -%}
            {%- endunless -%}
         
            {%- comment -%}
            ============================================================================================================
            MIN/MAX QUANTITY
            ============================================================================================================
            {%- endcomment -%}
         
            {%- if bold_apps_installed contains 'Customer Pricing' or bold_apps_installed contains 'Quantity Breaks' -%}
         
                {%- assign bold_product_min = false -%}
                {%- assign bold_product_max = false -%}
                {%- for tag in bold_product.tags -%}
                    {%- assign lowercase_tag = tag | downcase | replace: 'min ', 'min_' | replace: 'min-', 'min_' | replace: 'max ', 'max_' | replace: 'max-', 'max_' -%}
                    {%- assign lowercase_customer_tag = bold_product_customer_tag | downcase -%}
                    {%- if lowercase_tag contains 'min_' -%}
                        {%- assign tag_info = lowercase_tag | split: 'min_' -%}
                        {%- assign cust_tag = tag_info.first | strip -%}
                        {%- if tag_info.first == blank or cust_tag == lowercase_customer_tag -%}
                            {%- assign bold_product_min = tag_info | last | times: 1 %}
                        {%- endif -%}
                        {%- elsif lowercase_tag contains 'max_' -%}
                        {%- assign tag_info = lowercase_tag | split: 'max_' -%}
                        {%- assign cust_tag = tag_info.first | strip -%}
                        {%- if tag_info.first == blank or cust_tag == lowercase_customer_tag -%}
                            {%- assign bold_product_max = tag_info | last | times: 1 %}
                        {%- endif -%}
                    {%- endif -%}
                {%- endfor -%}
         
            {%- endif -%}
         
            {%- comment -%}
            ============================================================================================================
            BEGIN JSON OUTPUT
            ============================================================================================================
            {%- endcomment -%}
         
            {%- unless no_quick_shop_buy == true -%}
            {%- assign variant_ids = product | map: 'variants' | map: 'id' -%}
            {%- assign bold_variant_ids = bold_product.variants | map: 'id' -%}
            {%- capture bold_product_json -%}
            {%- if bold_product_endpoint == 'json' -%}
                {
                "product":
            {%- endif -%}
            {
            "id": {{- bold_product_id | default: bold_product.id | json -}},
            "title": {{- bold_product_title | default: bold_product.title | json -}},
         
            {%- if bold_product_endpoint == 'json' -%}
                "body_html": {{- bold_product.description | json -}},
                "template_suffix": {{- bold_product.template_suffix | json -}},
                "images": [
                {%- for image in bold_product.images -%}
                    {
                    "id": {{- image.id | json -}},
                    "product_id": {{- image.product_id | json -}},
                    "position": {{- image.position | json -}},
                    "src": {{- image.src | json -}},
                    "variant_ids": {{- variant_ids | json -}}
                    } {%- unless forloop.last -%},{%- endunless -%}
                {%- endfor -%}],
                "image":
                {
                "id": {{- bold_product.featured_image.id | json -}},
                "product_id": {{- bold_product.featured_image.product_id | json -}},
                "position": {{- bold_product.featured_image.position | json -}},
                "src": {{- bold_product.featured_image.src | json -}},
                "variant_ids": {{- variant_ids | json -}}
                },
            {%- endif -%}
         
            "handle": {{- bold_product_handle | default: bold_product.handle | json -}},
            "description": {{- bold_product.description | json -}},
            "published_at": {%- capture published_at -%}{{- bold_product.published_at | date: "%F" -}}T{{- bold_product.published_at | date: "%T" -}}{%- endcapture -%}{{- shop.timezone -}}{{- published_at | json -}},
            "created_at": {%- capture created_at -%}{{- bold_product.created_at | date: "%F" -}}T{{- bold_product.created_at | date: "%T" -}}{%- endcapture -%}{{- shop.timezone -}}{{- created_at | json -}},
            "vendor": {{- bold_product.vendor | json -}},
            "{%- if bold_product_endpoint == 'json' -%}product_{%- endif -%}type": {{- bold_product.type | json -}},
            "tags": {%- unless bold_product_endpoint == 'json' -%}{{- bold_product.tags | json -}}{%- else -%}{{- bold_product.tags | join: ',' | json -}}{%- endunless -%},
            "price": {{- bold_price | default: bold_product.price | json -}},
            "price_min": {{- bold_price_min | default: bold_product.price_min | json -}},
            "price_max": {{- bold_price_max | default: bold_product.price_max | json -}},
            "price_varies": {{- bold_price_varies | json -}},
            "compare_at_price": {{- bold_compare_at_price | default: bold_product.compare_at_price | json -}},
            "compare_at_price_min": {{- bold_compare_at_price_min | default: bold_product.compare_at_price_min | json -}},
            "compare_at_price_max": {{- bold_compare_at_price_max | default: bold_product.compare_at_price_max | json -}},
            "compare_at_price_varies": {{- bold_compare_at_price_varies | json -}},
            "all_variant_ids": {{- bold_variant_ids | json -}},
            "variants": {%- if variant_output_json -%}{{- variant_output_json -}}{%- else -%}{{- bold_product.variants | json -}}{%- endif -%},
            "available": {{- bold_product_available | json -}},
         
            {%- unless bold_product_endpoint == 'json' -%}
                "images": {{- bold_product.images | json -}},
            {%- endunless -%}
         
            "featured_image": {{- bold_product.featured_image | json -}},
            "options":
            {%- if bold_product_endpoint -%}
            [
            {%- for opt in bold_product.options -%}
                {%- assign option_name = 'options' | append: forloop.index -%}
                {
                "name": {{- opt | json -}},
                {%- if bold_product_endpoint == 'json' -%}"product_id":{{- bold_product.id | json -}},{%- endif -%}
                "position":{{-  forloop.index | json -}},
                "values":{{- [option_name] | json -}}
                } {%- unless forloop.last -%},{%- endunless -%}
            {%- endfor -%}
            ]
            {%- else -%}
                {{- bold_product.options | json -}}
            {%- endif -%},
            "url": {{- bold_product.url | json -}}
         
            {%- comment -%}FLAGS TO INDICATE WHICH APPS ARE IN PLAY {%- endcomment -%}
            {%- if product_has_btm -%},"hasBTM": true{%- endif -%}
            {%- if product_has_csp -%},"hasCSP": true{%- endif -%}
            {%- if product_has_qb -%},"hasQB": true{%- endif -%}
            {%- if product_has_ro -%},"hasRO": true{%- endif -%}
            {%- if product_has_bdl -%},"hasBDL": true{%- endif -%}
         
            {%- comment -%}SET MINIMUM/MAXIMUM QUANTITIES{%- endcomment -%}
            {%- if bold_product_min -%},"min": {{ bold_product_min | json }}{%- endif -%}
            {%- if bold_product_max -%},"max": {{ bold_product_max | json }}{%- endif -%}
            }
            {%- if bold_product_endpoint == 'json' -%}
                }
            {%- endif -%}
            {%- endcapture -%}
         
            {%- unless bold_product_output == 'json' or bold_product_output == 'none'-%}
                <script>
                  var currentScript = document.currentScript || document.scripts[document.scripts.length - 1];
                  var boldVariantIds = {{- bold_variant_ids | json -}};
                  var boldProductHandle = {{- bold_product.handle | json -}};
                  var BOLD = BOLD || {};
                  BOLD.products = BOLD.products || {};
                  BOLD.variant_lookup = BOLD.variant_lookup || {};
                  if (window.BOLD && !BOLD.common) {
                      BOLD.common = BOLD.common || {};
                      BOLD.common.Shopify = BOLD.common.Shopify || {};
                      window.BOLD.common.Shopify.products = window.BOLD.common.Shopify.products || {};
                      window.BOLD.common.Shopify.variants = window.BOLD.common.Shopify.variants || {};
                      window.BOLD.common.Shopify.handles = window.BOLD.common.Shopify.handles || {};
                      window.BOLD.common.Shopify.saveProduct = function (handle, product) {
                          if (typeof handle === 'string' && typeof window.BOLD.common.Shopify.products[handle] === 'undefined') {
                              if (typeof product === 'number') {
                                  window.BOLD.common.Shopify.handles[product] = handle;
                                  product = { id: product };
                              }
                              window.BOLD.common.Shopify.products[handle] = product;
                          }
                      };
                      window.BOLD.common.Shopify.saveVariant = function (variant_id, variant) {
                          if (typeof variant_id === 'number' && typeof window.BOLD.common.Shopify.variants[variant_id] === 'undefined') {
                              window.BOLD.common.Shopify.variants[variant_id] = variant;
                          }
                      };
                  }
         
                  for (var boldIndex = 0; boldIndex < boldVariantIds.length; boldIndex = boldIndex + 1) {
                    BOLD.variant_lookup[boldVariantIds[boldIndex]] = boldProductHandle;
                  }
         
                  BOLD.products[boldProductHandle] = {{- bold_product_json -}};
         
                  {%- if product_has_qb -%}
                  {%- assign qb_pricing_html = bold_product | map: 'variants' | map: 'metafields' | map: 'shappify_qb' | map: 'pricing_html' -%};
                  {%- assign csp_pricing_html = bold_product | map: 'variants' | map: 'metafields' | map: 'shappify_csp' | map: 'pricing_html' -%};
                  var pricingHTML = {%- if qb_pricing_html[0] -%}{{- qb_pricing_html | json -}}{%- else -%}{{- csp_pricing_html | json -}}{%- endif -%};
         
                  for (var boldIndex = 0; boldIndex < pricingHTML.length; boldIndex = boldIndex + 1) {
                    var element = document.createElement('DIV');
                    element.className = 'bold-hidden';
                    element.style.display = 'none';
                    element.id = 'variant_html_' + boldVariantIds[boldIndex];
                    element.innerHTML = pricingHTML[boldIndex];
         
                    if (document.body) {
                      document.body.prepend(element);
                    } else if (document.head) {
                      document.head.prepend(element);
                    }
                  }
                  {%- endif -%}
         
                  {%- assign bold_rp = product | map: 'variants' | map: 'metafields' | map: 'bold_rp' -%}
                  var boldCSPMetafields = {
                  {%- if bold_apps_installed contains 'Customer Pricing' -%}
                  {%- for variant in product.variants -%}{%- assign csp_metafield_namespace = variant.id | prepend: "csp" -%}{{variant.id}}:{{ product.metafields[csp_metafield_namespace] | json }}{%- unless forloop.last -%}, {%- endunless -%}{%- endfor -%}
                  {%- endif -%}
                  };
                  var boldTempProduct = {{- product | json -}};
                  var bold_rp = {{- bold_rp | json -}};
                  if(boldTempProduct){
                    window.BOLD.common.Shopify.saveProduct(boldTempProduct.handle, boldTempProduct.id);
                    for (var boldIndex = 0; boldTempProduct && boldIndex < boldTempProduct.variants.length; boldIndex = boldIndex + 1){
                      var rp_group_id = bold_rp[boldIndex].rp_group_id ? '' + bold_rp[boldIndex].rp_group_id : '';
                      window.BOLD.common.Shopify.saveVariant(
                          boldTempProduct.variants[boldIndex].id,
                          {
                            product_id: boldTempProduct.id,
                            product_handle: boldTempProduct.handle,
                            price: boldTempProduct.variants[boldIndex].price,
                            group_id: rp_group_id,
                            csp_metafield: boldCSPMetafields[boldTempProduct.variants[boldIndex].id]
                          }
                      );
                    }
                  }
         
                  currentScript.parentNode.removeChild(currentScript);
                </script>
            {%- endunless -%}
         
            {%- if bold_product_output == 'json' or bold_product_output == 'js' -%}
                {%- if escape_output -%}
                    {{- bold_product_json | strip_newlines | escape -}}
                {%- else -%}
                    {{- bold_product_json | strip_newlines -}}
                {%- endif -%}
            {%- endif -%}
         
            {%- if bold_hidden_product -%}
                {{- hidden_product_output -}}
            {%- endif -%}
            {%- endunless -%}
         
            {%- if bold_trigger_break -%}
                {%- break -%}
            {%- endif -%}
         
        {%- endif -%}
      7. {%- comment -%}
        BOLD-VARIANT.LIQUID
        Last updated: 2018-December-7
         
        Sets all appropriate liquid variables for Bold Apps that affect the variant.
        Creates an updated JSON object that includes key information relating to our apps.
        Combines the functionality of bold-hidden-variants, bold-base-variant and bold-variant-inventory
         
        FLAGS:
          base_product:      {product object}                          Base product object for the variant, used to check/set several properties. If not supplied, defaults to bold_product. If no bold_product is set, defaults to product
          line_item:         {line item object} | null (default)       If set, pass the line item to the included snippets - some apps may adjust prices differently depending on whether we're influencing the cart total or not
          output:            'json' | 'none'  (default)                Controls whether anything is printed to the DOM
          hide_action:       'skip' | 'none'  (default)                Forces a 'continue' to skip hidden variants when 'skip' is set
          customer_tag:      {string} | null (default)                 If set, forces bold-variant to calculate as though the customer had the specified tag
          price_style:       'json' | null (default)                   If set, sets prices as '10.00' instead of 1000
          custom_app_list:   {string} | null (default)                 List of apps to apply to the price. Associated snippets will be automatically included.  If not specified, will check for a shop metafield to get a list of all relevant apps that need to be included.
          third_party_check: false | true (default)                    If true, runs additional checks that we know about to be compatible with third-party apps
          additonal_includes: {string} | null (default)                 Additional snippets that need to be included after the initial liquid variable assignments (comma-delimited)
         
        {%- endcomment -%}
         
        {%- comment -%}
        ============================================================================================================
            ASSIGN LIQUID VARIABLES
        ============================================================================================================
        {%- endcomment -%}
         
         
        {%- comment -%} Assign flags to their default values if not set {%- endcomment -%}
         
        {%- assign bold_apps_installed = shop | map: 'metafields' | map: 'bold_apps_installed' | first -%}
         
        {%- assign bold_variant = bold-variant | default: variant -%}
        {%- assign bold_variant_line_item = line_item | default: false -%}
        {%- assign bold_variant_base_product = base_product | default: bold_product | default: bold_variant_line_item.product | default: product | default: item.product | default: item -%}
        {%- assign bold_variant_output = output | default: 'none' -%}
        {%- assign bold_variant_hide_action = hide_action | default: 'none' -%}
        {%- assign bold_variant_customer_tag = customer_tag | default: csp_customer_tag -%}
         
        {%- comment -%} Check for CSP visibility. Other 'hide' rules are based directly on metafields on the variants. {%- endcomment -%}
         
        {%- assign csp_hidden = false -%}
        {%- if bold_variant_hide_action == 'skip' and bold_apps_installed contains 'Customer Pricing' -%}
          {%- if shop.metafields.shop_csp_tag_group.shop_csp_tag or bold_variant.metafields.shappify_csp -%}
            {%- assign csp_flag_string = ' (' | append: bold_variant_customer_tag | append: ')' -%}
            {%- assign all_shop_tags = shop.metafields.shop_csp_tag_group.shop_csp_tag | append: ',default' | split: ',' -%}
         
            {%- unless bold_variant.metafields.shappify_csp.csp_tag == blank -%}
         
              {%- if bold_variant.metafields.shappify_csp.csp_tag == 'default' and bold_variant_customer_tag != 'default' -%}
                {%- if bold_variant_base_product -%}
                  {%- assign found_csp_level = false -%}
                  {%- assign csp_bases = bold_variant_base_product | map: 'variants' | map: 'metafields' | map: 'shappify_csp' |  map: 'csp_base' -%}
                  {%- assign csp_tags = bold_variant_base_product | map: 'variants' | map: 'metafields' | map: 'shappify_csp' |  map: 'csp_tag' -%}
                  {%- if csp_bases contains bold_variant.id and csp_tags contains bold_variant_customer_tag -%}{%- assign found_csp_level = true -%}{%- endif -%}
                  {%- if found_csp_level -%}{%- continue -%}{%- endif -%}
                {%- endif -%}
              {%- elsif bold_variant_customer_tag != bold_variant.metafields.shappify_csp.csp_tag -%}
                {%- continue -%}
              {%- endif -%}
            {%- assign bold_variant_title = bold_variant.title | remove: csp_flag_string -%}
            {%- endunless -%}
          {%- endif -%}
        {%- endif -%}
         
        {%- assign app_list = '' -%}
        {%- if app_list != blank and custom_app_list != blank -%}
          {%- assign bold_variant_app_list = app_list | append: ',' | append: custom_app_list -%}
        {%- else -%}
          {%- assign bold_variant_app_list = app_list | default: custom_app_list | default: false -%}
        {%- endif -%}
         
        {%- assign bold_variant_price = bold_variant.price -%}
         
        {%- if bold_variant_app_list -%}
         
          {%- assign bold_variant_app_list = bold_variant_app_list | split: ',' -%}
          {%- for app in bold_variant_app_list -%}
            {%- assign snippet_title = 'bold-' | append: app | append: '-variant' -%}
            {%- capture silence_output -%}
                {%- include snippet_title with bold_variant, base_product: bold_variant_base_product, line_item: bold_variant_line_item, customer_tag: bold_variant_customer_tag -%}
            {%- endcapture -%}
          {%- endfor -%}
         
        {%- endif -%}
         
        {%- assign bold_variant_available = bold_variant.available -%}
         
        {% if bold_apps_installed contains 'Quantity Breaks' or bold_apps_installed contains 'Customer Pricing' or bold_apps_installed contains 'Product Bundles' %}
          {%- comment -%} Find the base variant and base variant's inventory {%- endcomment -%}
          {%- assign bold_base_variant_id = bold_variant.metafields.shappify_csp['csp_base'] | default: bold_variant.metafields.shappify_qb['qb_parent'] | default: bold_variant.metafields.shappify_bundle['bundle_parent'] | default: bold_variant.id -%}
         
          {%- comment -%} Make sure we can find the indicated base variant! {%- endcomment -%}
          {%- assign bold_is_base_variant = true -%}
          {%- assign bold_base_variant = bold_variant -%}
          {%- unless bold_base_variant_id == bold_variant.id -%}
            {%- for variant_check in bold_variant_base_product.variants -%}
              {%- if variant_check.id == bold_base_variant_id -%}
                {%- assign bold_base_variant = variant_check -%}
                {%- assign bold_is_base_variant = false -%}
                {%- break -%}
              {%- endif -%}
            {%- endfor -%}
          {%- endunless -%}
         
          {%- comment -%} Assign inventory variables (based on the base_variant, if different from the current variant) {%- endcomment -%}
          {%- assign target_variant_inventory_quantity = bold_base_variant.inventory_quantity -%}
          {%- assign target_variant_inventory_policy = bold_base_variant.inventory_policy -%}
         
          {%- assign bold_variant_cart_quantity = 0 -%}
          {%- for inv_check_item in cart.items -%}
            {%- assign cart_variant = inv_check_item.variant -%}
            {%- assign cart_base_variant_id = cart_variant.metafields.shappify_csp['csp_base'] | default: cart_variant.metafields.shappify_qb['qb_parent'] | default: cart_variant.metafields.shappify_bundle['bundle_parent'] | default: cart_variant.id -%}
            {%- if cart_base_variant_id == bold_base_variant_id -%}
              {%- assign bold_variant_cart_quantity = bold_variant_cart_quantity | plus: inv_check_item.quantity -%}
            {%- endif -%}
          {%- endfor -%}
         
          {%- assign bold_variant_inventory_quantity =  bold_base_variant.inventory_quantity  -%}
          {%- assign bold_variant_remaining_quantity = bold_variant_inventory_quantity | minus: bold_variant_cart_quantity -%}
          {%- assign bold_variant_inventory_policy = bold_base_variant.inventory_policy -%}
          {%- assign bold_variant_inventory_management = bold_base_variant.inventory_management -%}
         
          {%- comment -%} Now that we've established quantity, re-evaluate the variant's availablility {%- endcomment -%}
          {%- if bold_variant_remaining_quantity <= 0 and bold_variant_inventory_policy == 'deny' and bold_variant_inventory_management != blank -%}
            {%- assign bold_variant_available = false -%}
          {%- endif -%}
         
         
          {%- comment -%} If we're calling this from bold-cart-item, also set the max quantity the line item can go up to {%- endcomment -%}
          {%- if bold_item and bold_variant_inventory_management != blank and bold_variant_inventory_policy == 'deny' -%}
            {%- assign bold_item_max_quantity = bold_item.quantity | plus: bold_variant_remaining_quantity -%}
          {%- else -%}
            {%- assign bold_item_max_quantity = '' -%}
          {%- endif -%}
         
          {%- comment -%} Check for QB level, hide variant and update title as appropriate {%- endcomment -%}
          {%- if bold_apps_installed contains 'Quantity Breaks'  or bold_apps_installed contains 'Customer Pricing' -%}
            {%- assign qb_hidden = false -%}
            {%- assign qb_level = bold_variant.metafields.shappify_qb.qb_qty | default: bold_variant.metafields.shappify_csp.csp_qty | times: 1 -%}
            {%- if qb_level > 1 -%}{%- assign qb_hidden = true -%}{%- endif -%}
            {%- if bold_variant.title == '1+' -%}
              {%- assign bold_variant_title = 'Default title' -%}
            {%- endif -%}
          {%- endif -%}
         
          {%- comment -%} If required, check for third-party Hide Rules as well {%- endcomment -%}
         
          {%- if third_party_check == blank -%}{%- assign third_party_check = true -%}{%- endif -%}
          {%- assign third_party_hidden = false -%}
          {%- if third_party_check -%}
            {%- if bold_variant.title contains '% Off' or bold_variant.metafields.brodev_scn.hide == "true" or bold_variant.metafields.secomapp.freegifts or bold_variant.title contains '(Bundle price)' -%}{%- assign third_party_hidden = true%}{%- endif -%}
          {%- endif -%}
         
          {%- if csp_hidden or qb_hidden or third_party_hidden or bold_variant.metafields.shappify_bundle.is_bundle == 'true' or third_party_hidden -%}
            {%- assign bold_hidden_variant = true -%}
          {%- else -%}
            {%- assign bold_hidden_variant = false -%}
          {%- endif -%}
         
         
          {%- comment -%} Check for presence of our apps {%- endcomment -%}
          {%- if bold_variant.metafields.bold_measurement.formula -%}{%- assign variant_has_btm = true -%}{%- else -%}{%- assign variant_has_btm = false -%}{%- endif -%}
          {%- if bold_variant.metafields.shappify_csp.csp_tag -%}{%- assign variant_has_csp = true -%}{%- else -%}{%- assign variant_has_csp = false -%}{%- endif -%}
          {%- if bold_variant.metafields.shappify_qb.pricing_html or bold_variant.metafields.shappify_csp.pricing_html -%}{%- assign variant_has_qb = true -%}{%- else -%}{%- assign variant_has_qb = false -%}{%- endif -%}
          {%- if bold_variant.metafields.bold_rp.rp_group_id -%}{%- assign variant_has_ro = true -%}{%- else -%}{%- assign variant_has_ro = false -%}{%- endif -%}
          {%- assign bdl_check = base_product.variants | map: 'metafields' | map: 'shappify_bundle' | map: 'bundle_parent' -%}
          {%- if bdl_check contains bold_variant.id -%}{%- assign variant_has_bdl = true -%}{%- else -%}{%- assign variant_has_bdl = false -%}{%- endif -%}
         
         
          {%- if bold_variant_hide_action == 'skip' and bold_hidden_variant -%}{%- continue -%}{%- endif -%}
        {% endif %}
         
          {%- assign option1_clean_name = variant.option1 | remove: csp_flag_string -%}
          {%- assign option2_clean_name = variant.option2 | remove: csp_flag_string -%}
          {%- assign option3_clean_name = variant.option3 | remove: csp_flag_string -%}
         
        {%- comment -%}
        ============================================================================================================
            BEGIN JSON OUTPUT
        ============================================================================================================
        {%- endcomment -%}
        {%- if bold_variant_output == 'json' -%}
        {
          "id":{{- bold_variant.id | json -}},
          "product_id":{{- bold_variant_base_product.id | json -}},
          "product_handle":{{- bold_variant_base_product.handle | json -}},
          "title":{{- bold_variant_title | default: bold_variant.title | json -}},
          "option1":{%- unless option1_clean_name == blank -%}{{- option1_clean_name | json -}}{%- else -%}null{%- endunless -%},
          "option2":{%- unless option2_clean_name == blank -%}{{- option2_clean_name | json -}}{%- else -%}null{%- endunless -%},
          "option3":{%- unless option3_clean_name == blank -%}{{- option3_clean_name | json -}}{%- else -%}null{%- endunless -%},
          "sku":{{- bold_variant.sku | json -}},
          "requires_shipping":{{- bold_variant.requires_shipping | json -}},
          "taxable":{{- bold_variant.taxable | json -}},
          "featured_image":
          {%- if bold_variant.featured_image == blank -%}
            {{bold_base_variant.featured_image | json}},
          {%- else -%}
            {
            "created_at":{%- capture created_at -%}{{- bold_variant.featured_image.created_at -}}T{{- bold_variant.featured_image.created_at | date: "%T" -}}{%- endcapture -%}{{- shop.timezone -}}{{- created_at | json -}},
            "id":{{- bold_variant.featured_image.id | json -}},
            "position":{{- bold_variant.featured_image.position | json -}},
            "product_id":{{- bold_variant.featured_image.product_id | json -}},
            "src":{{- bold_variant.featured_image.src | json -}},
            "updated_at":{%- capture updated_at -%}{{- bold_variant.featured_image.updated_at | date: "%F" -}}T{{- bold_variant.featured_image.updated_at | date: "%T" -}}{%- endcapture -%}{{- shop.timezone -}}{{- updated_at | json -}},
            "width":{{- bold_variant.featured_image.width -}},
            "height":{{- bold_variant.featured_image.height -}}
            },
          {%- endif -%}
         
          "image_id":{{variant.featured_image.id | default: bold_base_variant.featured_image.id | json -}},
          "available":{{- bold_variant_available | json -}},
          "name":{{- bold_variant_base_product.title | append: " - " | append: bold_variant.title | remove: csp_flag_string | json -}},
          "options":{{- bold_variant.options | json | remove: csp_flag_string -}},
          "price":{%- unless price_style == 'json' -%}{{- bold_variant_price | default: bold_variant.price | json -}}{%- else -%}{%- assign cents = bold_variant_price | default: bold_variant.price | modulo: 100 | prepend: '00' | slice: -2, 2 -%}{%- assign dollars = bold_variant_price | default: bold_variant.price | times: 0.01 | floor -%}{{- dollars | append: '.' | append: cents | json -}}{%- endunless -%},
          "weight":{{- bold_variant.weight | json -}},
          "compare_at_price":{%- if bold_base_variant.compare_at_price == blank -%}null{% else %}{%- unless price_style == 'json' -%}{{- bold_variant_compare_at_price | default: bold_variant.compare_at_price | json -}}{%- else -%}{%- assign cents = bold_variant_compare_at_price | default: bold_variant.compare_at_price | modulo: 100 | prepend: '00' | slice: -2, 2 -%}{%- assign dollars = bold_variant_compare_at_price | default: bold_variant.compare_at_price | times: 0.01 | floor -%}{{- dollars | append: '.' | append: cents | json -}}{%- endunless -%}{%- endif -%},
          "inventory_quantity":{{- bold_variant_inventory_quantity | default: variant.inventory_quantity | json -}},
          "inventory_management":{{- bold_variant_inventory_management | default: variant.inventory_management | json -}},
          "inventory_policy":{{- bold_variant_inventory_policy | default: variant.inventory_policy | json -}},
          "inventory_in_cart":  {{- bold_variant_cart_quantity | default: 0 | json -}},
          "inventory_remaining":{{- bold_variant_remaining_quantity | default: bold_variant_inventory_quantity | default: bold_variant.inventory_quantity | json -}},
          "incoming":{{- bold_variant.incoming | default: bold_base_variant.incoming | json -}},
          "next_incoming_date":{{- bold_variant.next_incoming_date  | default: bold_base_variant.next_incoming_date | date: "%Y-%m-%d" | json -}},
          "taxable":{%- unless bold_variant_taxable == blank -%}{{- bold_variant_taxable | json -}}{%- else -%}{{- bold_variant.taxable | json -}}{%- endunless -%},
          "barcode":{{- variant.barcode | json -}}
         
        {% comment %}
          {%- comment -%} SPECIAL HANDLING FOR CSP {%- endcomment -%}
          {%- if variant_has_csp -%}
            ,"csp_lookup":{
              {%- for tag in all_shop_tags -%}
                {%- assign found_variant = '' -%}
                {%- if forloop.first != true -%},{%- endif -%}{{- tag | json -}}:
                {%- for csp_variant in bold_variant_base_product.variants -%}
                  {%- if csp_variant.metafields.shappify_csp.csp_qty and csp_variant.metafields.shappify_csp.csp_qty != 1 -%}{%- continue -%}{%- endif -%}
                  {%- assign base_check = csp_variant.metafields.shappify_csp.csp_base | default: csp_variant.id -%}
                  {%- if base_check == bold_base_variant.id and csp_variant.metafields.shappify_csp.csp_tag == tag -%}
                    {%- assign found_variant = csp_variant -%}
                    {{- break -}}
                  {%- endif -%}
                {%- endfor -%}
                {
                  "id":{{- found_variant.id | json -}},
                  "price":{{- found_variant.price | json -}}
                  {%- if found_variant.metafields.shappify_csp.pricing_html -%},"grid":{{- found_variant.metafields.shappify_csp.pricing_html | json -}}{%- endif -%}
                }
              {%- endfor -%}
            }
          {%- endif -%}
          {%- comment -%} END OF CSP SPECIAL HANDLING {%- endcomment -%}
         
          {%- comment -%} SPECIAL HANDLING FOR BTM {%- endcomment -%}
          {%- if variant_has_btm -%}
            ,"btm_lookup":{{- bold_variant.metafields.bold_measurement | json -}}
          {%- endif -%}
          {%- comment -%} END OF BTM SPECIAL HANDLING {%- endcomment -%}
         
          {%- comment -%} SPECIAL HANDLING FOR QB {%- endcomment -%}
          {%- if variant_has_qb -%}
            ,"qb_lookup":{
              "levels": {
              {%- assign qb_price_varies = false -%}
              {%- assign not_first_tag = false -%}
              {%- for qb_variant in bold_variant_base_product.variants -%}
                {%- if qb_variant.metafields.shappify_qb.qb_parent == bold_variant.id or qb_variant.metafields.shappify_csp.csp_base == bold_base_variant.id or qb_variant.id == bold_base_variant.id -%}
                  {%- if qb_variant.metafields.shappify_csp.csp_tag == blank or qb_variant.metafields.shappify_csp.csp_tag == bold_variant_customer_tag -%}
                    {%- if not_first_tag -%},{%- endif -%}{%- assign not_first_tag = true -%}
                    {%- unless qb_variant.price == bold_variant.price -%}{%- assign qb_price_varies = true -%}{%- endunless -%}
                    "{{- qb_variant.metafields.shappify_qb.qb_qty | default: qb_variant.metafields.shappify_csp.csp_qty | default: 1 -}}": {"id":{{- qb_variant.id -}},"price":{{- qb_variant.price -}}}
                  {%- endif -%}
                {%- endif -%}
              {%- endfor -%}
              }
              {%- if qb_price_varies -%}
                ,"qb_price_varies": {{- qb_price_varies | json -}}
                ,"grid": {{- bold_variant.metafields.shappify_qb.pricing_html | default: bold_variant.metafields.shappify_csp.pricing_html | json -}}
              {%- endif -%}
            }
          {%- endif -%}
          {%- comment -%} END OF QB SPECIAL HANDLING {%- endcomment -%}
         
          {%- comment -%} SPECIAL HANDLING FOR RO {%- endcomment -%}
          {%- if variant_has_ro -%}
            ,"ro_lookup":{{- bold_variant.metafields.bold_rp | json | remove: 'rp_' -}}
          {%- endif -%}
          {%- comment -%} END OF RO SPECIAL HANDLING {%- endcomment -%}
         
          {%- comment -%} SPECIAL HANDLING FOR BUNDLES {%- endcomment -%}
          {%- if variant_has_bdl -%}
            ,"bdl_lookup":{
            {%- for bdl_variant in base_product.variants -%}
              {%- unless bold_variant.id == bdl_variant.metafields.shappify_bundle.bundle_parent -%}{%- continue -%}{%- endunless -%}
              "id":{{- bdl_variant.id -}},
              "price":{{- bdl_variant.price | json -}},
              "bundle_group":{{- bdl_variant.metafields.shappify_bundle.bundle_group -}}
              {%- break -%}
            {%- endfor -%}
            }
          {%- endif -%}
          {%- comment -%} END OF BUNDLES SPECIAL HANDLING {%- endcomment -%}
        {% endcomment %}
        }
        {%- endif -%}
  7. Click Save.
  8. Repeat Steps 6.1 - 6.4 for each missing snippet file.

 

Step 2: Edit theme.liquid

  1. Under Layout, select theme.liquid.
  2. Copy and paste the following code directly below the {{ content_for_header }} line:
    {% render 'bold-common' %}
    {% render 'bold-includes' %}

    copy and paste the code

  3. Copy and paste the following code directly above the </body> tag:
    <script type="text/javascript" charset="utf-8"> var shappify_customer_tags = {{ customer.tags | json }} </script>

    copy and paste the code

  4. Click Save.

 

Step 3: Edit collection.liquid

  1. Under Templates, select collection.liquid.

    Note: The contents for this file may be located under Sections in the collection-template.liquid file.

  2. Find the following line of code:
    {% for product in collection.products %}

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

    find the code

  3. Copy and paste this code directly below each instance:
    {%-include 'bold-product' with product, hide_action: 'skip' -%}

    Add the code

  4. Click Save.

 

Step 4: Edit index.liquid

  1. Under Templates, select index.liquid.
  2. Find the following line of code:
    {% for product in collection.products %}

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

    Find the code

  3. Copy and paste this code directly below each instance:
    {% include 'bold-product' with product, hide_action: 'skip' %}

    copy and paste the code

  4. Click Save.

 

Step 5: Edit related-products.liquid

  1. Under Snippets, select related-products.liquid.
  2. Find the following line of code:
    {% for product in collection.products %}

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

    find the code

  3. Copy and paste this code directly below each instance:
    {% include 'bold-product' with product, hide_action: 'skip' %}

    copy and paste the code

  4. Click Save.

 

Step 6: Edit search.liquid

  1. Under Templates, select search.liquid.
  2. Find the following line of code:
    {% for item in search.results %}

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

    Find the code

  3. Copy and paste this code directly below each instance:
    {% include 'bold-product' with item, hide_action: 'skip' -%}

    Copy and paste the code

  4. Click Save.

 

Step 7: Edit product.liquid

  1. Under Templates, select product.liquid.

    Note: The contents for this file may be located under "Sections" in the product-template.liquid file.

  2. Copy and paste the following code at the top of this file:
    {% include 'bold-product' with product, hide_action: 'break' %}{% if bold_hidden_product %}{% break %}{%endif %}

    Copy and paste the code

  3. Find the following line of code:
    {% for variant in product.variants %}

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

    find the code

  4. Copy and paste this code directly below each instance:
    {% include 'bold-variant' with variant, hide_action: 'skip' %}

    Paste the code

  5. Find the following line of code:
    {% assign current_variant = product.selected_or_first_available_variant %}

    Note: This line of code may use a different variable name. Common variable names include variant and pr_variant

    Find the code

    Change this line of code to:
    {% assign current_variant = bold_selected_or_first_available_variant %}

    Change the code

  6. Copy and paste the following code directly below this line:
    {%- include 'bold-variant' with current_variant, output: 'none' -%}

    Note: Depending on your theme, you may need to use variant as the variable in the above code.

    Copy and paste the code

  7. Find the following line of code containing:
    product.variants.size

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

    Find the code

    Change this line of code to:
    bold_variants_size

    Change the code

  8. Find the following line of code:
    {{ product | json }}

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

    Find the code

    Change this line of code to:
    {%- include 'bold-product', output: 'json' -%}

    Change the code

  9. Find the opening <form> tag.

    Note: The following steps are for adding the Quantity Breaks grid. If you do not wish to activate the Quantity Breaks module, please skip to Step 14.

    Find the code

  10. Copy and paste the following code within the <form> tag:
    <div class="bold_qb_grid" data-variant-id="{{ product.selected_or_first_available_variant.id }}"></div>

    Note: This is where the Quantity Breaks grid displays on your storefront. We generally suggest placing this after the variant selector element.

    Copy and paste the code

  11. Click Save.

 

Step 8: Edit cart.liquid

  1. Under Templates, select cart.liquid.

    Note: The contents for this file may be located under Sections in the cart-template.liquid file.

  2. Copy and paste the following code at the top of this file:
    {%- include 'bold-cart' -%}

    Copy and paste the code

  3. Find the following line of code:
    {% for item in cart.items %}

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

    Find the code

  4. Copy and paste this code directly below each instance:
    {%- include 'bold-cart-item' with item -%}

    Copy and paste the code

  5. Find each instance of the following code:
    {{ item.price | money }}
    On newer themes, it will be:
    {{ item.final_price | money }}

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

    Find the code

  6. Copy and paste the following code in front of each instance:
    <span class="Bold-theme-hook-DO-NOT-DELETE bold_cart_item_price" data-item-key="{{item.key}}" style="display:none !important;"></span>

    Paste the code

  7. Find each instance of the following code:
    {{ item.line_price | money }}
    On newer themes, it will be:
    {{ item.final_line_price | money }}

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

    Find the code

  8. Copy and paste the following code in front of each instance:
    <span class="Bold-theme-hook-DO-NOT-DELETE bold_cart_item_total" data-item-key="{{item.key}}" style="display:none !important;"></span>

    Paste the code

  9. Find each instance of the following code:
    {{ cart.total_price | money }}

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

    Find the code

  10. Copy and paste the following code in front of each instance:
    <span class="Bold-theme-hook-DO-NOT-DELETE bold_cart_total" style="display:none !important;"></span>

    Copy and paste the code

  11. Find the opening <form> tag.

    Note: The following steps are for adding the Quantity Breaks grid. If you do not wish to activate the Quantity Breaks module, please skip to Step 16.

    Find the opening form tag

  12. Copy and paste the following code above the opening <form> tag:
    <div id="shappify-qty-cart-msg"></div>

    Paste the code

  13. Click Save.

 

Step 9: Edit bold-includes.liquid

  1. Under Snippets, select bold-includes.liquid.
  2. Copy and paste this code in the bottom of the file.
    {{ 'https://cp.boldapps.net/js/csp.js' | script_tag }}

    Copy and paste the code

  3. Click Save.

 

Step 10: Update the Pricing Code

Updates need to be done on all theme files that output product prices on the store. The number and name of these files will vary from theme to theme. Generally, 3-5 files will need to be updated.

These control the price fields on the product, collection, search, related products, and home pages.

It's important that each theme file that outputs a price be modified. This is to ensure the correct pricing always shows for your customers.

Note: This requires you to go back and edit multiple files within your theme's Liquid coding.

Go through the list of files one at a time and reference your theme's files to see if that particular file exists in your theme. Not all of these files exist in a given theme.

 

List of Theme Files to Update:

  • Templates: All themes should contain these files. If your theme is using Sections, these files should be located within the Sections folder as *-template.liquid files.
    • product.liquid
    • index.liquid
    • collection.liquid
    • search.liquid
  • Snippets: Any given theme should typically have several of these files.
    • product-block.liquid
    • product-card.liquid
    • product-form.liquid
    • product-grid-collage.liquid
    • product-grid-item-category.liquid
    • product-grid-item.liquid
    • product-list-item.liquid
    • product-listing.liquid
    • product-loop.liquid
    • product-single.liquid
    • product-thumbnail.liquid
    • product.liquid
    • related-products.liquid
    • search-result-grid.liquid
    • search-result.liquid
    • search.liquid
    • short-form.liquid
    • snippet-product-item.liquid

 

Original Pricing Code vs. Bold Pricing Code:

Not all of these will appear in a given file, but the ones that do may appear several times.

These are each of the code snippets that need to be replaced, and the code to replace them:

Look for each of these... ...and replace all instances with this code

product.price or item.price

bold_price

product.price_min or item.price_min

bold_price_min

product.price_max or item.price_max

bold_price_max

product.price_varies or item.price_varies

bold_price_varies

product.compare_at_price or item.compare_at_price

bold_compare_at_price

product.compare_at_price_min or item.compare_at_price_min

bold_compare_at_price_min

product_compare_at_price_max or item.compare_at_price_max

bold_compare_at_price_max

product.compare_at_price_varies or item.compare_at_price_varies

bold_compare_at_price_varies

product.selected_or_first_available_variant or item.selected_or_first_available_variant

bold_selected_or_first_available_variant

product.variants.first or item.variants.first

bold_selected_or_first_available_variant

product.variants[0] or item.variants[0]

bold_selected_or_first_available_variant

 

Step 11: Test the Install

To test your Custom Pricing installation, please follow these steps:

 

Create Your Pricing Groups:

  1. Log into the Custom Pricing app admin.
  2. Create a new pricing tier and a tag associated with the new tier.
  3. Create a new Custom Pricing group, assign a small discount for the new tier (Example 1%), and select a single product to apply the discount to.
  4. In the Shopify admin, create a customer account, and assign the tag associated with your new pricing tier to the account.

Test on the Storefront:

  1. On the storefront, navigate to the search page and search for the product that you selected in the app. If the search page shows a price field, check to see if the price is the regular price.
  2. Go to any collection page that has the selected product on it and verify that the price shown is the regular product price.
  3. Go to the product page and check the variant drop-down selector to make sure that the app's variants aren't showing there.
  4. While on the product page, check to see if the product page's price is showing the product's regular price.
  5. Log into the customer account that you created earlier, navigate back to the search page and search for the product that you selected in the app. If the search page shows a price field, make sure that the price is the app's discounted price.
  6. Go to any collection page and verify that the price shown is the discounted app pricing.
  7. While on the product page, make sure that the product page's price field is showing the app's discounted price.

If any of the above steps fail, please contact our Customer Success team for further assistance.

 


 

Uninstall

The app embeds can be turned off or Liquid code can be removed by going through the steps above to find their location. If you'd like help removing any Liquid code from your theme files, please reach out to our Customer Success team.

To cancel your subscription to Custom Pricing and remove the app from your store, please follow these steps:

  1. In Custom Pricing, navigate to Settings > General, and click Pause All Groups, or Global Clear > Delete All and wait for the sync to complete. This automatically turns off all active pricing groups and reverts your product prices to their original state.
  2. From your Shopify admin, click Settings.
  3. Click Apps and sales channels.
  4. Click the three dots next to Bold Custom Pricing, and select Uninstall.
  5. Optional: Select a reason for the uninstall.
  6. Click Uninstall.