Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="application/ld+json">
- {
- "@context": "http://schema.org/",
- "@type": "IndividualProduct",
- "name": "{{ product.title | escape }}",
- "url": "{{ shop.url }}{{ product.url }}",
- {%- if product.variants.first.sku != blank -%}
- "sku": "{{ product.variants.first.sku }}",
- {%- endif -%}
- {% if product.variants.first.barcode.size == 13 %} "gtin13": {{ product.first_available_variant.barcode }}, {% endif %}
- {%- if product.featured_image -%}
- {%- assign image_size = product.featured_image.width | append: 'x' -%}
- "image": [
- "https:{{ product.featured_image.src | img_url: image_size }}"
- ],
- {%- endif -%}
- {%- if current_variant.sku != blank -%}
- "sku": "{{ current_variant.sku }}",
- {%- endif -%}
- "brand": {
- "@type": "Thing",
- "name": "{{ product.vendor | escape }}"
- },
- "offers": [
- {%- for variant in product.variants -%}
- {
- "@type" : "Offer",
- {%- if variant.sku != blank -%}
- "sku": "{{ variant.sku }}",
- {%- endif -%}
- "availability" : "http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}",
- "price" : "{{ variant.price | divided_by: 100.00 }}",
- "priceCurrency" : "{{ cart.currency.iso_code }}",
- "url" : "{{ shop.url }}{{ variant.url }}"
- }{% unless forloop.last %},{% endunless %}
- {%- endfor -%}
- ],
- "description": "{{ product.description | strip_html | escape | strip | strip_newlines }}"
- }
- </script>
- <script type="application/ld+json">
- {
- "@context": "https://schema.org",
- "@id": "#product",
- "@type": "SomeProducts",
- "additionalType": "{{ shop.url }}{{ product.url }}",
- "description": "{{ product.description | strip_html | escape | strip | strip_newlines }}",
- "name": "{{ product.title | escape }}"
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement