SmartSize script is not running in my theme

SmartSize script is not running in my theme

In rare cases, the app script may not be running in your theme. To resolve this issue, please follow these steps:

First click on "Edit code" in the dropdown to open the code editor for your theme:




There are 2 things to add to your theme:


First, on the left hand side, scroll to Snippet section and add a new snippet. 





Name it smartSize.liquid



Next, inside the file, copy the following content:

‚Äč
<script>
window.sizefox = window.sizefox === undefined ? {} : window.sizefox;
sizefox.shop = "{{ shop.permanent_domain }}";
{% assign t = template | prepend: '/' | append: '.' %}
{% if t contains '/product.' %}
sizefox.data = {
  collections: "{{ product.collections | map: 'id' | join: ',' }}",
  tags: {{ product.tags | join: ',' | json }},
  product: "{{ product.id }}",
  productname: "{{ product.title | replace: '"', '"' }}",
  type: {{ product.type | json }}
};
{% endif %}
fetch(https://server.smartsize.io/sizepopupversion?shopname= + sizefox.shop)
.then (response => response.json())
.then(json => {console.log("Using SmartSize popup version: ", json)

scripturl = json.url;
  const smartScript = document.getElementById("smartsizeScript");
  smartScript.src = scripturl
});
</script>


Then click save. You should have a file that looks like this (see below). Make sure that you SAVE it.









    • Related Articles

    • Script SmartSize is not running in my theme

      In rare cases, the app script may not be running in your theme. To resolve this issue, please follow these steps: Locate the file "Sections/main-product.liquid" or a similar file in your theme. Copy the code provided below and paste it into the ...
    • How can I add a SmartSize block in my Shopify Theme?

      Before you start, please make sure that you have a Shopify 2.0 theme and ensure that the SmartSize app has been already installed and embedded in your Shopify store. Now, let's start with the process: 1. **Log in to your Shopify Store:** Start by ...
    • Have you changed your theme recently?

      If you have changed your theme recently, you will need to re-enable SmartSize again! This may be done via adding a block or adding a line of code (code snippet) in your theme. See instructions here on how to enable the app.
    • How can I use the same font style as in my Shopify theme?

      Feature for SmartSize v1 users Would you like to use the same font style both for your size charts and for your theme? Open your SmartSize app Go to Settings Go to Font Style Select Theme Style This will automatically take the font style of your ...
    • SmartSize appears embedded in Shopify

      SmartSize should always open in a new Tab. SmartSize is not an embedded app (image #1). If SmartSize appears embedded in your Shopify Admin panel, try to re-open it by navigating to the right menu and selecting Apps (image #2) Image #1 Image #2