Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% comment %}
- ** Product - default view **
- - Product template
- {% endcomment %}
- {% assign collection_handles = product.collections | map: 'handle' %}
- {% assign variant = product.selected_or_first_available_variant %}
- <section class="product__page mainContentArea">
- <div class="product__container container">
- <div class="product-{{ product.id }}"
- data-free-text="{{ settings.free_price_text }}"
- data-product-id="{{ product.id }}"
- >
- <div class="section product__section clearfix js-product_section imageAlign--{{ section.settings.product_images_position }} flexContainer sixteen columns">
- <div class="product__images">
- <div class="banner_holder bannerPosition--{{ section.settings.product_images_position }}">
- {% if product.available %}
- {% if settings.sale_banner_enabled and product.compare_at_price_max > product.price %}
- <div class="sale_banner thumbnail_banner">
- <span class="banner_text">{{ 'collections.general.sale' | t }}</span>
- </div>
- {% endif %}
- {% endif %}
- {% if collection_handles contains 'new' %}
- <div class="new_banner thumbnail_banner">
- <span class="banner_text">{{ 'collections.general.new' | t }}</span>
- </div>
- {% endif %}
- {% if collection_handles contains 'pre-order' %}
- <div class="preorder_banner thumbnail_banner">
- <span class="banner_text">{{ 'collections.general.pre_order' | t }}</span>
- </div>
- {% endif %}
- </div>
- {% include 'product-images', set_product_height: section.settings.set_product_height %}
- </div>
- <div class="product__details productText">
- {% if section.settings.enable_shopify_product_badges and settings.enable_shopify_review_comments %}
- <div class="product__stars">
- <span class="shopify-product-reviews-badge" data-id="{{ product.id }}"></span>
- </div>
- {% endif %}
- {% if section.settings.display_vendor or section.settings.display_sku %}
- <p class="product__vendor">
- {% if section.settings.display_vendor %}
- <span class="vendor">{{ product.vendor | link_to_vendor }}</span>
- {% endif %}
- {% if section.settings.display_vendor and section.settings.display_sku and variant.sku != blank %}
- |
- {% endif %}
- </p>
- {% endif %}
- {% if variant.sku != blank and section.settings.display_sku %}
- <p class="product__sku">
- <span>{{ variant.sku }}</span>
- </p>
- {% endif %}
- {% if section.settings.display_collections and product.collections.size > 0 %}
- <p class="productInfo--collection">
- <span class="label">{{ 'products.product.collections' | t }}:</span>
- <span>
- {% for col in product.collections %}
- <a href="{{ col.url }}" title="{{ col.title }}">{{ col.title }}</a>{% unless forloop.last %},{% endunless %}
- {% endfor %}
- </span>
- </p>
- {% endif %}
- <h1 class="product__title">{{ product.title }}</h1>
- {% assign product_tags = product.tags | join: ' ' %}
- {% if product_tags contains 'meta-size-chart-' %}
- {% for tag in product.tags %}
- {% if tag contains 'meta-size-chart-' %}
- <a href="#" class="size_chart" data-featherlight="#size-chart{{ product.id }}">{{ 'products.product.size_chart' | t }} <span class="icon-right-arrow"></span></a>
- {% include 'popup-size-chart', product_id: product.id %}
- {% endif %}
- {% endfor %}
- {% elsif settings.size_chart != blank %}
- <a href="#" class="size_chart" data-featherlight="#size-chart{{ product.id }}">{{ 'products.product.size_chart' | t }} <span class="icon-right-arrow"></span></a>
- {% include 'popup-size-chart', product_id: product.id %}
- {% endif %}
- {% if collection_handles contains 'coming-soon' %}
- <p class="product__price modal_price">{{ 'collections.general.coming_soon' | t }}</p>
- {% else %}
- <p class="product__price modal_price">
- <span itemprop="price" content="{{ variant.price | money_without_currency | remove: "," }}" class="{% if variant.compare_at_price > variant.price %}sale{% endif %}">
- <span class="current_price {% if product.available == false %}sold_out_price{% endif %}">
- {% if variant.price > 0 %}
- <span class="money">{{ variant.price | money }}</span>
- {% else %}
- {{ settings.free_price_text }}
- {% endif %}
- </span>
- </span>
- <span class="was_price {% if product.available == false %}sold_out_price{% endif %}">
- {% if variant.price < variant.compare_at_price and variant.available %}
- <span class="money">{{ variant.compare_at_price | money }}</span>
- {% endif %}
- </span>
- {% if section.settings.display_savings %}
- <span class="savings {% if product.available == false %}sold_out_price{% endif %}">
- {% if variant.price < variant.compare_at_price and variant.available %}
- {{ 'products.product.savings' | t }} {{ variant.compare_at_price | minus: variant.price | times: 100 | divided_by: variant.compare_at_price }}% (<span class="money">{{ variant.compare_at_price | minus: variant.price | money }}</span>)
- {% endif %}
- </span>
- {% endif %}
- <span class="sold_out sold_out_text sale">{% if variant.available == false %} — {{ 'products.product.sold_out' | t }}{% endif %}</span>
- </p>
- {% endif %}
- {% if section.settings.product_form_position == 'bottom' %}
- <div class="description-bottom">
- {% unless collection_handles contains 'coming-soon' %}
- {% include 'product-form' with 'product' %}
- {% include 'product-notify-me' %}
- {% endunless %}
- </div>
- {% endif %}
- {% if section.settings.product_form_position == 'top' %}
- {% unless collection_handles contains 'coming-soon' %}
- {% include 'product-form' with 'product' %}
- {% include 'product-notify-me' %}
- {% endunless %}
- {% endif %}
- <div class="product__social socialShare">
- {% if section.settings.display_social_buttons %}
- <p class="product__socialLabel socialShare__text">{{ 'blogs.article.share_this' | t }}</p>
- {% include "social-buttons" with "product" %}
- {% endif %}
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="container">
- <div class="sixteen columns">
- <div class="product__description description clearfix">
- {{ product.description }}
- </div>
- </div>
- </div>
- {% if section.settings.enable_reviews %}
- {% include 'include-reviews' %}
- {% endif %}
- </section>
- {% if section.settings.set_product_height %}
- {% style %}
- .gallery-wrap model-viewer {
- min-height: {{ section.settings.product_height }}px;
- }
- .gallery-wrap .product_gallery img,
- .gallery-wrap .product_gallery .plyr--html5 video,
- .gallery-wrap .product_gallery .plyr--youtube {
- max-height: {{ section.settings.product_height }}px;
- }
- {% endstyle %}
- {% endif %}
- {% comment %} Shopify-XR {% endcomment %}
- {% if product.media %}
- <script>
- window.ShopifyXR=window.ShopifyXR||function(){(ShopifyXR.q=ShopifyXR.q||[]).push(arguments)}
- {% assign models = product.media | where: 'media_type', 'model' | json %}
- ShopifyXR('addModels', {{ models }});
- </script>
- {% endif %}
- {% schema %}
- {
- "name": "Product",
- "class": "product-template",
- "settings": [
- {
- "type": "header",
- "content": "Product gallery"
- },
- {
- "type": "checkbox",
- "id": "product_thumbs",
- "label": "Show thumbnails",
- "default": true
- },
- {
- "type": "checkbox",
- "id": "gallery_arrows",
- "label": "Show arrows",
- "default": true
- },
- {
- "type": "checkbox",
- "id": "activate_zoom",
- "label": "Magnify product images on hover",
- "default": false
- },
- {
- "type": "range",
- "id": "slideshow_speed",
- "label": "Gallery speed",
- "min": 0,
- "max": 6,
- "unit": "sec",
- "default": 0,
- "info": "Set to 0 to disable autoplay."
- },
- {
- "type": "select",
- "id": "slideshow_animation",
- "label": "Gallery transition",
- "options": [
- {
- "value": "slide",
- "label": "Slide"
- },
- {
- "value": "fade",
- "label": "Fade"
- }
- ],
- "default": "slide"
- },
- {
- "type": "select",
- "id": "thumbnail_position",
- "label": "Thumbnails",
- "default": "bottom-thumbnails",
- "options": [
- {
- "value": "left-thumbnails",
- "label": "Left"
- },
- {
- "value": "right-thumbnails",
- "label": "Right"
- },
- {
- "value": "bottom-thumbnails",
- "label": "Bottom"
- }
- ]
- },
- {
- "type": "checkbox",
- "id": "enable_thumbnail_slider",
- "label": "Enable thumbnail slider",
- "default": true
- },
- {
- "type": "header",
- "content": "Product information"
- },
- {
- "type": "checkbox",
- "id": "enable_shopify_product_badges",
- "label": "Display star rating on product",
- "info": "Reviews app must be enabled. [Learn more](https://help.outofthesandbox.com/hc/en-us/articles/360008549274#section2)",
- "default": false
- },
- {
- "type": "checkbox",
- "id": "display_collections",
- "label": "Show collections"
- },
- {
- "type": "checkbox",
- "id": "display_vendor",
- "label": "Show vendor"
- },
- {
- "type": "checkbox",
- "id": "display_sku",
- "label": "Show SKU"
- },
- {
- "type": "checkbox",
- "id": "display_savings",
- "label": "Show price savings",
- "default": true
- },
- {
- "type": "radio",
- "id": "product_form_position",
- "label": "Description position",
- "options": [
- {
- "value": "top",
- "label": "Above 'add to cart'"
- },
- {
- "value": "bottom",
- "label": "Below 'add to cart'"
- }
- ]
- },
- {
- "type": "header",
- "content": "Dynamic checkout button"
- },
- {
- "type": "checkbox",
- "id": "show_payment_button",
- "label": "Show dynamic checkout button",
- "default": true,
- "info": "Each customer will see their preferred payment method from those available on your store, such as PayPal or Apple Pay. [Learn more](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)"
- },
- {
- "type": "checkbox",
- "id": "display_social_buttons",
- "label": "Show social media share icons",
- "default": true
- },
- {
- "type": "header",
- "content": "Product reviews"
- },
- {
- "type": "checkbox",
- "id": "enable_reviews",
- "label": "Show product reviews",
- "info": "You will need to install the free [Shopify Product Reviews](https://apps.shopify.com/product-reviews) app.",
- "default": true
- },
- {
- "type": "header",
- "content": "Media",
- "info": "Learn more about [media types](https://help.shopify.com/en/manual/products/product-media)"
- },
- {
- "type": "radio",
- "id": "product_images_position",
- "label": "Media position",
- "options": [
- {
- "value": "left",
- "label": "Left"
- },
- {
- "value": "right",
- "label": "Right"
- }
- ]
- },
- {
- "type": "checkbox",
- "id": "set_product_height",
- "label": "Set height of product media",
- "default": false
- },
- {
- "type": "range",
- "id": "product_height",
- "label": "Product media height",
- "min": 200,
- "max": 800,
- "step": 10,
- "default": 500,
- "unit": "px"
- },
- {
- "type": "checkbox",
- "id": "video_looping",
- "label": "Enable video looping",
- "default": false
- }
- ]
- }
- {% endschema %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement