If the New method of CPB app doesn't fit you, for example, if you use the product type for other purposes, you can easily revert it to the Old method.
1. Go to the "Theme" and press "Edit code".
2. Among the snippets you need to find "customproductbuilder-initializer.liquid" and make a back-up of it in case you have custom code.
3. Substitute the code in this snippet with this (+custom code in case you had any):
{% assign custombuilder = shop.metafields.customproductbuilder %}
{% if custombuilder %}
{% assign productEditor = custombuilder.productEditor %}
{% assign productList = productEditor | split: ',' %}
{% assign productId = product.id | append: '' %}
{% if productList contains productId%}
{{ 'https://code.jquery.com/jquery-3.0.0.min.js' | script_tag }}
{{ 'https://cdn.shopify.com/s/assets/external/app.js' | script_tag }}
{{ 'customproductbuilder.css' | asset_url | stylesheet_tag }}
<div
id="product-builder"
shop-name="{{shop.permanent_domain}}"
product-id="{{product.id}}"
styles-path="{{'customproductbuilder.css' | asset_url }}"
data-cpb-user-id="{{customer.id}}"
data-cpb-configuration-url={{ product.metafields.customproductbuilder['configurableUrl'] }}
></div>
{{'https://cdn.thecustomproductbuilder.com/dist/latest/custom-product-builder.js' | script_tag}}
{{'https://cdn.thecustomproductbuilder.com/dist/latest/customizer-theme-main.js'| script_tag}}
{% else %}
{% section 'product-template' %}
{% endif %}
{% else %}
{% section 'product-template' %}
{% endif %}
IMPORTANT: Make sure that the section you theme uses is named 'product-template'. If it is named the other way (for ex. 'product') you will need to substitute the line {% section 'product-template' %} with the correct name of the section.
4. Open the CPB App and go the "Global Settings" tab.
5. Unflag the "Get Products by type "cpb_products" line.
6. Press "Save"
Comments
0 comments
Please sign in to leave a comment.