POC Sports NA ONLY/eyefitu-sizing.liquid

    0

    0

    Dmitry Gurendo

    The core functionality of algorithms.

    for NA adding imperial units coming by default.

    <!-- eyefitu_widget -->
    
    {% if request.page_type == "product" %}
    
      {% assign place = shop.metafields.eyefitu.app_settings.place | default:'before' %}
      {% assign selector = shop.metafields.eyefitu.app_settings.selector | default: 'form[action="/cart/add"]' %}
      {% assign gaGenderDimensionIndex = shop.metafields.eyefitu.app_settings.gaGenderDimensionIndex | default: false %}
    
      {%- if product.featured_image -%}
        {%- assign image_size = product.featured_image.width | append: 'x' -%}
        {%- assign image_url = product.featured_image.src | img_url: image_size -%}
        {%- assign image_https = 'https:' | append: image_url -%}
      {%- endif -%}
    
      {% assign sizeOption = null %}
    
    
      {% for product_option in product.options_with_values %}
        {% if product_option.name == "Size" %}
          {%- assign sizeOption = "option" | append: product_option.position -%}
        {% endif %}
      {% endfor %}
    
      {% assign gender = product.metafields.eyefitu.gender | default:'female' %}
      {% assign displayVisualSizeCharts = shop.metafields.eyefitu.app_settings.displayVisualSizeCharts | default: false %}
      {% assign visualSizeChartTitle = product.vendor | append: " - " | append: product.type  %}
    
      <script type="application/javascript">
        window.eyefituShopifyOptions = {
          selector: '{{ selector }}',
          place: "{{ place }}",
          dataAttributes: {
            productId: 'gid://shopify/Product/{{ product.id }}',
            image: "{{ image_https }}",
            brand: "{{ product.vendor }}",
            product: "{{ product.type }}",
            gender: "{{ gender }}",
            defaultUnits: "imperial",
            language: '{{ shop.locale }}',
            {% if gaGenderDimensionIndex != false %}
            gaGenderDimensionIndex: {{ gaGenderDimensionIndex }},
            {% endif %}
            {% if displayVisualSizeCharts != false %}
            visualSizeChart: true,
            {% endif %}
            {% if sizeOption %}
            sizes: '[{% for variant in product.variants %}"{{variant[sizeOption]}}"{% if forloop.last != true %}, {% endif %}{% endfor %}]',
            {% else %}
            sizes: '["all"]',
            {% endif %}
            visualSizeChartTitle: "{{ visualSizeChartTitle }}",
          },
        };
      </script>
    
      <style>
      {% include "eyefitu-styles" %}
      </style>
    
      {% capture eyefitu_custom %}{% include "eyefitu-custom" %}{% endcapture %}
      {% unless eyefitu_custom contains "Liquid error" %}
        {{ eyefitu_custom }}
      {% endunless %}
    {% endif %}
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.