Skip to content

Instantly share code, notes, and snippets.

View haroldao's full-sized avatar
🎯
Design + Dev

Harold AO haroldao

🎯
Design + Dev
View GitHub Profile
@haroldao
haroldao / Schema Product Page - Shopify (product.liquid)
Last active December 19, 2020 16:59
Schema Product Page - Shopify (product.liquid)
{% assign current_variant = product.selected_or_first_available_variant %}
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"name": {{ product.title | json }},
"url": {{ shop.url | append: product.url | json }},
{%- if product.featured_media -%}
{%- assign media_size = product.featured_media.preview_image.width | append: 'x' -%}
<!-- /snippets/schema-markup.liquid -->
<script type="application/ld+json">
{%- if template == 'index' -%}
{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "{{ shop.name }}",
"alternateName": "{{ shop.description }}",
"url": "{{ shop.url }}"