If you want to test Kiwi Sizing Chart & Recommender on an unpublished theme but can't afford to publish it temporarily, follow these steps:
Go to Online Store > Themes.
Click on Edit code in the dropdown to open the code editor for your theme.
On the left-hand side, scroll to the Snippets section and add a new snippet. Name it
kiwiSizing
(the .liquid extension will be added automatically).
Inside the newly created file, copy and paste the following content:
<script>
window.KiwiSizing = window.KiwiSizing === undefined ? {} : window.KiwiSizing;
KiwiSizing.shop = "{{ shop.permanent_domain }}";
{% assign t = template | prepend: '/' | append: '.' %}
{% if t contains '/product.' %}
{% capture custom_variants %} {% endcapture %}
{% for variant in product.variants %}
{% capture variant_object %}
{"id": {{ variant.id }}, "title": {{ variant.title | json }}, "available": {{ variant.available }}}
{% endcapture %}
{% assign custom_variants = custom_variants | append: variant_object %}
{% if forloop.last == false %}
{% assign custom_variants = custom_variants | append: ',' %}
{% endif %}
{% endfor %}
{% assign custom_variants_json = '[' | append: custom_variants | append: ']' %}
KiwiSizing.data = {
collections: "{{ product.collections | map: 'id' | join: ',' }}",
tags: {{ product.tags | join: ',' | json }},
product: "{{ product.id }}",
vendor: {{ product.vendor | json }},
type: {{ product.type | json }},
title: {{ product.title | json }},
images: {{ product.images | json }},
options: {{ product.options_with_values | json }},
variants: {{ custom_variants_json | strip_newlines | strip_html }},
waitForElementSelector: "",
waitForElementDelay: 5,
};
{% endif %}
</script>Click the Save button. Your snippet file should look like this:
Next, open the
theme.liquid
file. Add the following liquid render tag right above the closing</head>
tag:
{% render 'kiwiSizing' %}
Click Save. You should now be able to see size charts on your unpublished theme!
Important Update
If the Kiwi snippet is missing from your theme for any reason, follow the same process to redeploy it.
Please note that due to recent Shopify updates, the feature allowing customers to redeploy the snippet with a single click has been deprecated. Refer to this article for proper redeployment instructions.
If you have any questions or need assistance, please reach out to our support!