Created
August 10, 2018 21:57
-
-
Save whistlerbrad/e8b3b9ac3d7ecd36c772db58a24b307a to your computer and use it in GitHub Desktop.
Non-responsive images version - Snippet file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div itemscope itemtype="http://schema.org/Product" class="product-page"> | |
| <div class="wrapper"> | |
| <meta itemprop="url" content="{{ shop.url }}{{ product.url }}"> | |
| <meta itemprop="image" content="{{ product.featured_image.src | img_url: 'grande' }}"> | |
| {% if section.settings.product_breadcrumbs %} | |
| {% include 'breadcrumb' %} | |
| {% endif %} | |
| {% assign current_variant = product.selected_or_first_available_variant %} | |
| {%- assign product_image_width = 'large--two-thirds' -%} | |
| {%- assign product_description_width = 'large--one-third' -%} | |
| <div class="grid product-single"> | |
| <div class="grid__item {{ product_image_width }} text-center"> | |
| <div class="product__slides product-single__photos" id="ProductPhoto-{{ section.id }}"> | |
| {% assign featured_image = current_variant.featured_image | default: product.featured_image %} | |
| <div class="product__photo" data-thumb="{{ featured_image.src | img_url: 'small_cropped' }}"> | |
| <img src="{{ featured_image | img_url: '1024x1024' }}" alt="{{ image.alt | escape }}" | |
| {% if section.settings.zoom_enable %}data-mfp-src="{{ featured_image | img_url: '2048x2048' }}"{% endif %} | |
| data-image-id="{{ featured_image.id }}" | |
| class="ProductImg-{{ section.id }}"> | |
| {% if featured_image.alt contains 'youtube.com' or featured_image.alt contains 'vimeo.com' %} | |
| <a href="{{ featured_image.alt }}" class="productVideo product__play icon-fallback-text"> | |
| <span class="icon icon-play">{% include 'svg-play', play_color: settings.product_background_color %}</span> | |
| <span class="fallback-text">►</span> | |
| </a> | |
| {% endif %} | |
| </div> | |
| {% for image in product.images %} | |
| {% unless image contains featured_image %} | |
| <div class="product__photo{% unless forloop.first == true %} product__photo--additional{% endunless %}" data-thumb="{{ image.src | img_url: 'small_cropped' }}"> | |
| <img src="{{ image.src | img_url: '1024x1024' }}" alt="{{ image.alt | escape }}" | |
| {% if section.settings.zoom_enable %}data-mfp-src="{{ image.src | img_url: '2048x2048' }}"{% endif %} | |
| data-image-id="{{ image.id }}" | |
| class="ProductImg-{{ section.id }}"> | |
| {% if image.alt contains 'youtube.com' or image.alt contains 'vimeo.com' %} | |
| <a href="{{ image.alt }}" class="productVideo product__play icon-fallback-text"> | |
| <span class="icon icon-play">{% include 'svg-play', play_color: settings.color_border %}</span> | |
| <span class="fallback-text">►</span> | |
| </a> | |
| {% endif %} | |
| </div> | |
| {% endunless %} | |
| {% endfor %} | |
| </div> | |
| <div id="ProductThumbs-{{ section.id }}" class="product__thumbs--square"></div> | |
| </div> | |
| <div class="grid__item {{ product_description_width }}" id="productInfo-{{ section.id }}"> | |
| <div class="text-center"> | |
| <h5 class="product__price uppercase h5{% if current_variant.compare_at_price > current_variant.price %} on-sale{% endif %}"> | |
| <span class="money"><span id="ProductPrice-{{ section.id }}">{{ current_variant.price | money }}</span></span> | |
| <p class="small compare-at em" id="ComparePriceWrapper-{{ section.id }}" {% unless current_variant.compare_at_price > current_variant.price %}style="display: none"{% endunless %}> | |
| <span class="money"><span id="ComparePrice-{{ section.id }}">{{ product.compare_at_price_max | money }}</span></span> | |
| </p> | |
| </h5> | |
| {% if section.settings.product_show_vendor and product.vendor %} | |
| <p><a href="{{ product.vendor | url_for_vendor }}" class="border-bottom-link uppercase">{{ product.vendor }}</a></p> | |
| {% endif %} | |
| <h1 itemprop="name" class="h2">{{ product.title }}</h1> | |
| {% comment %} | |
| If the product description is over 1000 characters or contains an embed code, | |
| place the description in a full width container below the image and cart button. | |
| {% endcomment %} | |
| {% assign description_position = '' %} | |
| {%- assign product_description_content = product.description -%} | |
| {%- assign has_tabs = false -%} | |
| {%- for block in section.blocks -%} | |
| {%- if block.type == "tab_description" -%} | |
| {%- assign has_tabs = true -%} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%-if has_tabs -%} | |
| {%- assign product_description_content = product_description_content | split: '<h6>' | first -%} | |
| {%- endif -%} | |
| {% if product_description_content contains '[split]' %} | |
| {% assign description_position = 'both' %} | |
| {% endif %} | |
| <div class="product-description rte" itemprop="description"> | |
| {{ product_description_content | replace: '<p>[split]</p>', '[split]' | split: '[split]' | first }} | |
| </div> | |
| {% comment %} | |
| Optional size chart - controlled by Magnific Popup | |
| {% endcomment %} | |
| {% if section.settings.info_page != blank %} | |
| {% assign size_page = pages[section.settings.info_page] %} | |
| <p> | |
| <a id="toggleProductModal-{{ section.id }}" class="border-bottom-link uppercase" data-mfp-src="#ProductModal-{{ section.id }}"> | |
| {{ size_page.title }} | |
| </a> | |
| </p> | |
| <div id="ProductModal-{{ section.id }}" class="product-modal mfp-hide"> | |
| <div class="rte">{{ size_page.content }}</div> | |
| </div> | |
| {% endif %} | |
| </div> | |
| {%- if section.blocks.size > 0 and section.settings.tabs_position == 'sidebar'-%} | |
| <div class="tabs-wrapper productTabsWrapper"> | |
| {% include 'product-tabs' %} | |
| </div> | |
| {%- endif -%} | |
| <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> | |
| <meta itemprop="priceCurrency" content="{{ shop.currency }}"> | |
| <meta itemprop="price" content="{{ product.selected_or_first_available_variant.price | money_without_currency | strip_html }}"> | |
| <link itemprop="availability" href="http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}"> | |
| {% include 'product-form' %} | |
| </div> | |
| {% if settings.product_social_enable %} | |
| {% capture link %}{{ shop.url }}{{ product.url }}{% endcapture %} | |
| {% capture shareTitle %}{{ product.title | url_param_escape }}{% endcapture %} | |
| <div class="share text-center" data-permalink="{{ link }}"> | |
| {% if settings.share_enable_facebook %} | |
| <a target="_blank" href="//www.facebook.com/sharer.php?u={{ link }}" class="share__link"> | |
| <span class="icon icon-facebook" aria-hidden="true"></span> | |
| <span class="share__text">{{ 'general.share.facebook' | t }}</span> | |
| </a> | |
| {% endif %} | |
| {% if settings.share_enable_twitter %} | |
| <a target="_blank" href="//twitter.com/share?url={{ link }}&text={{ shareTitle }}" class="share__link"> | |
| <span class="icon icon-twitter" aria-hidden="true"></span> | |
| <span class="share__text">{{ 'general.share.twitter' | t }}</span> | |
| </a> | |
| {% endif %} | |
| {% if settings.share_enable_pinterest %} | |
| <a target="_blank" href="http://pinterest.com/pin/create/button/?url={{ link }}&media={{ product.featured_image | product_img_url: '1024x1024' | prepend: 'http:' }}&description={{ shareTitle }}" class="share__link"> | |
| <span class="icon icon-pinterest" aria-hidden="true"></span> | |
| <span class="share__text">{{ 'general.share.pinterest' | t }}</span> | |
| </a> | |
| {% endif %} | |
| {% if settings.share_enable_google %} | |
| <a target="_blank" href="//plus.google.com/share?url={{ link }}" class="share__link"> | |
| <span class="icon icon-google" aria-hidden="true"></span> | |
| <span class="share__text">{{ 'general.share.google' | t }}</span> | |
| </a> | |
| {% endif %} | |
| </div> | |
| {% endif %} | |
| {% comment %} | |
| If the user is on a collection product page (ie with /collections/collection-handle/products/product-handle) | |
| in the URL, we can show next/previous links to other products in the collection. | |
| {% endcomment %} | |
| {% if collection and section.settings.product_nav_enable %} | |
| {% if collection.previous_product or collection.next_product %} | |
| <p class="product__arrows"> | |
| {% if collection.previous_product %} | |
| {% capture prev_url %}{{ collection.previous_product}}#content{% endcapture %} | |
| <span class="left"> | |
| <a href="{{ prev_url }}" class="btn btn--clear btn--small uppercase" rel="prev"> | |
| {{ 'products.general.previous_product_html' | t }} | |
| </a> | |
| </span> | |
| {% endif %} | |
| {% if collection.next_product %} | |
| {% capture next_url %}{{ collection.next_product}}#content{% endcapture %} | |
| <span class="right"> | |
| <a href="{{ next_url }}" class="btn btn--clear btn--small uppercase" rel="next"> | |
| {{ 'products.general.next_product_html' | t }} | |
| </a> | |
| </span> | |
| {% endif %} | |
| </p> | |
| {% endif %} | |
| {% endif %} | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| {% if description_position == 'both' %} | |
| <div class="wrapper"> | |
| <div class="product-description--below rte" itemprop="description"> | |
| {{ product_description_content | replace: '<p>[split]</p>', '[split]' | split: '[split]' | last }} | |
| </div> | |
| </div> | |
| {% endif %} | |
| {%- if section.blocks.size > 0 and section.settings.tabs_position == 'below' -%} | |
| <div class="wrapper tabs-wrapper productTabsWrapper"> | |
| {% include 'product-tabs' %} | |
| </div> | |
| {%- endif -%} | |
| {%- if section.settings.product_reviews_enable -%} | |
| <div class="wrapper"> | |
| <div id="shopify-product-reviews" data-id="{{product.id}}">{{ product.metafields.spr.reviews }}</div> | |
| </div> | |
| {%- endif -%} | |
| {% if section.settings.related_products_enable %} | |
| {% include 'product-related-items' %} | |
| {% endif %} | |
| <script type="application/json" id="ProductJson-{{ section.id }}"> | |
| {{ product | json }} | |
| </script> | |
| {% include 'icon-bar' %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment