Add the size chart to the homepage (featured products)

Add this code to your featured-product.liquid template after product is defined.

After this code

{% assign product = ... %}

Add this code

{% if product != empty %}
  <script>

  sizeChartsRelentless.product = {{product | json}};

  {% if product.collections %}
    sizeChartsRelentless.productCollections = {{product.collections | json}};
  {% endif %}

  {% if all_products[product.handle].metafields.sizechartsrelentless.size_charts %}
    sizeChartsRelentless.metafield = {{all_products[product.handle].metafields.sizechartsrelentless.size_charts}};
  {% endif %}

  </script>
{% endif %}
Was this article helpful?
Dislike 0

Pin It on Pinterest