Anti-Flicker Modes
Anti-flicker Modes
<head>
...
// This is the anti-flicker script:
<script>
window.igSettings = {
hideBody: true
}
</script>
// Your full theme script must go below it, with xxxxxxxxxxxx replaced by your customer ID:
<script>
window.Shopify = window.Shopify || {theme: {id: {{ theme.id }}, role: '{{ theme.role }}' } };
window._template = {
directory: "{{ template.directory }}",
name: "{{ template.name }}",
suffix: "{{ template.suffix }}"
};
window.__productIdFromTemplate = {{ product.id | json }};
window.__plpCollectionIdFromTemplate = {{ collection.id | json }};
window.igProductData = (function() {
const data = {};
{%- if template.name == 'collection' -%}
{%- for product in collection.products -%}
data["{{ product.id }}"] = {
productId: {{ product.id | json }},
handle: {{ product.handle | json }},
tags: {{ product.tags | json }},
collectionIds: [{% for col in product.collections %}{{ col.id }}{% unless forloop.last %},{% endunless %}{% endfor %}],
inventory: {% assign total = 0 %}{% for v in product.variants %}{% assign total = total | plus: v.inventory_quantity %}{% endfor %}{{ total }},
lowestVariantPrice: {{ product.price_min }}
};
{%- endfor -%}
{%- elsif template.name == 'product' -%}
data["{{ product.id }}"] = {
productId: {{ product.id | json }},
handle: {{ product.handle | json }},
tags: {{ product.tags | json }},
collectionIds: [{% for col in product.collections %}{{ col.id }}{% unless forloop.last %},{% endunless %}{% endfor %}],
inventory: {% assign total = 0 %}{% for v in product.variants %}{% assign total = total | plus: v.inventory_quantity %}{% endfor %}{{ total }},
lowestVariantPrice: {{ product.price_min }}
};
{%- endif -%}
return data;
})();
</script>
<script type="module" blocking="render" fetchpriority="high" src="https://cdn.intelligems.io/esm/xxxxxxxxxxxx/bundle.js" async></script>
...
</head>My Site is Still Flickering
Last updated