Skip to content

Instantly share code, notes, and snippets.

@UPC278999
Created August 6, 2020 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UPC278999/b674abfefcd6f82085311b4327f543e3 to your computer and use it in GitHub Desktop.
Save UPC278999/b674abfefcd6f82085311b4327f543e3 to your computer and use it in GitHub Desktop.
{%- comment -%}
<!--
This is the default split(50:50) product layout
-->
{%- endcomment -%}
{% assign all_tags = product.tags | downcase %}
{% comment %}
PDP layout settings
Product Media Block, take options 'slider' or 'scrolling'
Product Core Block, take options 'slider' or 'scrolling'
Metafields Block, take options 'tab' or 'accordion'
Render reviews in Tab, take options true or false
{% endcomment %}
{%- assign pdp_layout = 'slider' -%}
{%- assign metaFields_layout = 'tab' -%}
{%- assign renderReviewsInTab = false -%}
{%- assign pdp_layout_scrolling_grid = 'scrolling-grid' -%}
{%- assign current_variant = product.selected_or_first_available_variant -%}
{%- assign featured_image = current_variant.featured_image | default: product.featured_image -%}
{%- unless settings.enable_review -%}
{% assign renderReviewsInTab = false %}
{%- endunless -%}
{%- unless pdp_layout == 'scrolling' -%}
{% assign pdp_layout_scrolling_grid = '' %}
{%- endunless -%}
{% comment %} Is Gift Card {% endcomment %}
{%- if product.type == "Gift Card" -%}
{% assign pdp_layout = 'slider' %}
{% assign isGiftCard = 'gift-card' %}
{%- else -%}
{% assign isGiftCard = false %}
{%- endif -%}
{% comment %} {%- include 'breadcrumb' -%} {% endcomment %}
<div itemscope itemtype="http://schema.org/Product">
<meta itemprop="name" content="{{ product.title }}{% unless product.has_only_default_variant %} - {{ current_variant.title }}{% endunless %}">
<meta itemprop="url" content="{{ shop.url }}{{ current_variant.url }}">
<meta itemprop="brand" content="{{ product.vendor }}">
<meta itemprop="image" content="{{ featured_image | img_url: '600x600' }}">
<meta itemprop="description" content="{{ product.description | strip_html | escape }}">
<div class="product-detail-container {% if isGiftCard != blank %}{{ isGiftCard }}{% else %}{{ pdp_layout_scrolling_grid }}{% endif %}" data-layout="{{ pdp_layout }}">
{%- include 'product-core', product: product, current_variant: current_variant, featured_image: featured_image, layout: pdp_layout -%}
{%- include 'product-media', product: product, current_variant: current_variant, featured_image: featured_image, layout: pdp_layout -%}
<div class="scrolling-fix-stopper"></div>
{% if isGiftCard == false %}
<div class="product-extra">
{%- include 'product-content-video' -%}
{% comment %} {%- include 'product-metafield', product: product, layout: metaFields_layout, -%} {% endcomment %}
{% include 'product-recommended-tabs' %}
{%- if settings.enable_review and renderReviewsInTab == false -%}
{%- include 'product-reviews', review_widget: 'reviews' -%}
{%- endif -%}
</div>
{% endif %}
</div>
</div>
{%- include 'product-size-chart' -%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment