Product Pages

Sample structured data prepared with Pixfizz Liquid objects

{% if product %}
    <script type="application/ld+json" id="product-schema">
    {
      "@context": "http://schema.org",
      "@type": "Product",
      {%- unless product.is_static %}
        "sku": "{{ design.id }}:{{ product.code }}",
      {%- else %} 
        "sku": "{{ product.code }}",
      {%- endunless %}
      "offers": {
        "@type": "Offer",
        "availability":"https://schema.org/InStock",
        "price": "{{ product.price }}",
        "priceCurrency": "{{ website.currency_code }}",
        "url": "https://{{ website.hostname }}{{ request.fullpath }}",
        "priceValidUntil": {%- dynamic %}{%- assign date = 'today' | date: '%Y-%m-%d' | date: '%s' %}{%- assign seconds = 5 | times: 24 | times: 60 | times: 60 %}"{{ date | date: '%s' | plus: seconds | date: '%Y-%m-%d' }}"{% enddynamic %}
        },
      "brand": {
        "@type": "Brand",
        "name": "{{ website.title | escape_json }}"
        },
      "name": "{{ design.name }} {{ product.name | escape_json }}",
      "description": "{{ design.description | strip_html | escape_json }}",
      "category": "{% if product.custom.google_product_category != blank %}{{ product.custom.google_product_category }}{% else %}{{ product.category | escape_json }}{% endif %}",
      "url": "https://{{ website.hostname }}{{ request.fullpath }}",
      "image": "https://{{ website.hostname }}/v1/themes/{{ design.id }}/preview.jpg?product_id={{ product.id }}&height=800"
    }
    </script>
{% endif %}

Image code for Design Asset

"image": https://{{ website.hostname }}{{ design.image | asset_url: 1000 | replace: '//cdn.pixfizz.com', '' }}"

Image code for Product Asset

"image": https://{{ website.hostname }}{{ product.image | asset_url: 1000 | replace: '//cdn.pixfizz.com', '' }}"

Image code for Design Preview Images

{% assign image = design.preview_images | page_size: 2 | page: 1 | first %}
"image": "https://{{ website.hostname }}{{ image | asset_url: 1000 | replace: '//cdn.pixfizz.com', '' }}"

Image code for Product Preview Images

{% assign image = product.preview_images | page_size: 2 | page: 1 | first %}
"image": "https://{{ website.hostname }}{{ image | asset_url: 1000 | replace: '//cdn.pixfizz.com', '' }}"

Image code for live preview

"image": "https://{{ website.hostname }}/v1/themes/{{ design.id }}/preview.jpg?product_id={{ product.id }}&height=1000"

Last updated