first commit
This commit is contained in:
297
sections/product-template.liquid
Normal file
297
sections/product-template.liquid
Normal file
@@ -0,0 +1,297 @@
|
||||
{% if section.settings.product_breadcrumb == false %}
|
||||
{% style %}
|
||||
.container .breadcrumb__wrapper {
|
||||
display: none;
|
||||
}
|
||||
{% endstyle %}
|
||||
{% endif %}
|
||||
|
||||
<div class="sixteen columns" data-initial-width="sixteen" data-sidebar-width="twelve">
|
||||
<div class="product-{{ product.id }}">
|
||||
<div class="section product_section clearfix {% if product.images.size > 1 %}thumbnail_position--{{settings.thumbnail_position}} {% endif %} product_slideshow_animation--{{settings.product_slideshow_animation}}"
|
||||
data-thumbnail="{{settings.thumbnail_position}}"
|
||||
data-slideshow-animation="{{settings.product_slideshow_animation}}"
|
||||
data-slideshow-speed="{{settings.slideshow_speed}}">
|
||||
|
||||
<div class="eight columns product-image--align-{{ section.settings.product_images_position }} {% if section.settings.product_images_position == 'left' %}alpha{% else %}omega{% endif %}" data-initial-width="eight" data-sidebar-width="six">
|
||||
{% include 'product-images' %}
|
||||
</div>
|
||||
|
||||
<div class="product__description seven columns {% if section.settings.product_images_position == 'left' %}omega product__description--right{% else %}alpha product__description--left{% endif %}" data-initial-width="seven" data-sidebar-width="five">
|
||||
<div id="shopify-product-reviews" data-id="{{product.id}}">{{ product.metafields.spr.reviews }}</div>
|
||||
{% assign collection_handles = product.collections | map: 'handle' %}
|
||||
{% assign variant = product.selected_or_first_available_variant %}
|
||||
{% assign variant_price = variant.price %}
|
||||
{% assign variant_compare_at_price = variant.compare_at_price %}
|
||||
|
||||
{%- liquid
|
||||
assign variant_price = variant.metafields.app--168074346497.auto_discounted_price.value | default: variant.price
|
||||
|
||||
if variant.metafields.app--168074346497.discount_type.value != nil and variant.metafields.app--168074346497.discount_type.value != "fixed" and product.metafields.app--168074346497.discount_percentage.value > 0.01
|
||||
assign deducted_percentage = 1.0 | minus: product.metafields.app--168074346497.discount_percentage.value
|
||||
|
||||
if variant.metafields.app--168074346497.discount_percentage.value > 0.01
|
||||
assign deducted_percentage = 1.0 | minus: variant.metafields.app--168074346497.discount_percentage.value
|
||||
endif
|
||||
|
||||
assign variant_price = variant.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil
|
||||
|
||||
assign variant_compare_at_price = variant.price
|
||||
|
||||
if variant.compare_at_price > variant_compare_at_price
|
||||
assign variant_compare_at_price = variant.compare_at_price
|
||||
endif
|
||||
endif
|
||||
|
||||
if variant_price < variant.price and variant_compare_at_price == blank
|
||||
assign variant_compare_at_price = variant.price
|
||||
endif
|
||||
-%}
|
||||
|
||||
{% if collection and section.settings.show_collection_link %}
|
||||
<a class="product_collection" title="{{ collection.title | escape }}" href="{{ collection.url }}">
|
||||
{{ collection.title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<h1 class="product_name">{{ product.title }}</h1>
|
||||
<!-- Start of Judge.me code -->
|
||||
<div style='{{ jm_style }}' class='jdgm-widget jdgm-preview-badge' data-id='{{ product.id }}' data-auto-install='false'>
|
||||
{{ product.metafields.judgeme.badge }}
|
||||
</div>
|
||||
<!-- End of Judge.me code -->
|
||||
<span class="stamped-product-reviews-badge stamped-main-badge" data-id="{{product.id}}" data-product-title="{{product.title}}" data-product-type="{{product.type}}" style="display: block;"></span>
|
||||
|
||||
{% if settings.enable_shopify_product_badges %}
|
||||
<span class="shopify-product-reviews-badge" data-id="{{ product.id }}"></span>
|
||||
{% endif %}
|
||||
|
||||
{% if section.settings.display_vendor %}
|
||||
<p class="vendor">
|
||||
{{ product.vendor | link_to_vendor }}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if variant.sku != blank and section.settings.display_sku %}
|
||||
<p class="sku">
|
||||
{{ variant.sku }}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if collection_handles contains 'coming-soon' %}
|
||||
<p class="modal_price">{{ 'collections.general.coming_soon' | t }}</p>
|
||||
{% else %}
|
||||
<p class="modal_price">
|
||||
<span class="sold_out">{% if variant.available == false %}{{ 'products.product.sold_out' | t }}{% endif %}</span>
|
||||
<span 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 %}hidden{% 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 variant_price < variant_compare_at_price and variant.available %}
|
||||
<span class="money">{{ variant_compare_at_price | money }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</p>
|
||||
|
||||
{% include 'product-notify-me' %}
|
||||
{% endif %}
|
||||
|
||||
{% if section.settings.product_description_position == "top" %}
|
||||
{% if product.description != blank %}
|
||||
<div class="description">
|
||||
{{ product.description | split: '<!-- split -->' | first }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% unless collection_handles contains 'coming-soon' %}
|
||||
{% include 'product-form' with 'product' %}
|
||||
{% endunless %}
|
||||
|
||||
{% if settings.enable_shopify_review_comments and settings.review_position == "top" %}
|
||||
<div id="shopify-product-reviews" data-id="{{product.id}}">{{ product.metafields.spr.reviews }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if section.settings.product_description_position == "bottom" %}
|
||||
{% if product.available %}<hr />{% endif %}
|
||||
{% if product.description != blank %}
|
||||
<div class="description">
|
||||
{{ product.description | split: '<!-- split -->' | first }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if section.settings.display_collections or section.settings.display_tags or section.settings.display_type %}
|
||||
<hr />
|
||||
{% endif %}
|
||||
|
||||
<div class="meta">
|
||||
{% if section.settings.display_collections %}
|
||||
<p>
|
||||
<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 %}
|
||||
|
||||
{% if section.settings.display_tags %}
|
||||
<p>
|
||||
{% for tag in product.tags %}
|
||||
{% if forloop.first %}
|
||||
<span class="label">{{ 'products.product.tags' | t }}:</span>
|
||||
{% endif %}
|
||||
|
||||
{% unless tag contains 'meta-' %}
|
||||
<span>
|
||||
<a href="/collections/{% if collection %}{{ collection.handle }}{% else %}all{% endif %}/{{ tag | handle }}" title="{{ 'products.product.products_tagged' | t: tag: tag }}">{{ tag }}</a>{% unless forloop.last %},{% endunless %}
|
||||
</span>
|
||||
{% endunless %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if section.settings.display_type %}
|
||||
<p>
|
||||
<span class="label">{{ 'products.product.product_types' | t }}:</span> <span>{{ product.type | link_to_type }}</span>
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if section.settings.display_vendor %}
|
||||
<p>
|
||||
<span class="label">{{ 'products.product.vendor' | t }}:</span> <span>{{ product.vendor | link_to_vendor }}</span>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% include "social-buttons" with "product" %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if product.description contains "<!-- split -->" %}
|
||||
<br class="clear" />
|
||||
<div class="section clearfix">
|
||||
<div class="description">
|
||||
{{ product.description | split: '<!-- split -->' | last }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if settings.enable_shopify_review_comments and settings.review_position == "bottom" %}
|
||||
<div class="sixteen columns" data-initial-width="sixteen" data-sidebar-width="twelve">
|
||||
<div id="shopify-product-reviews" data-id="{{product.id}}">{{ product.metafields.spr.reviews }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- Start of Judge.me code -->
|
||||
<div style='clear:both'></div>
|
||||
<div id='judgeme_product_reviews' class='jdgm-widget jdgm-review-widget' data-product-title='{{ product.title | escape }}' data-id='{{ product.id }}' data-auto-install='false'>
|
||||
{{ product.metafields.judgeme.widget }}
|
||||
</div>
|
||||
<!-- End of Judge.me code -->
|
||||
</div>
|
||||
|
||||
{% schema %}
|
||||
|
||||
{
|
||||
"name": "Product",
|
||||
"class": "product-template-section clearfix",
|
||||
"settings": [
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "product_breadcrumb",
|
||||
"label": "Show breadcrumb links",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "show_collection_link",
|
||||
"label": "Show collection link",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "display_sku",
|
||||
"label": "Show SKU"
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "display_tags",
|
||||
"label": "Show tags"
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "display_type",
|
||||
"label": "Show type"
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "display_vendor",
|
||||
"label": "Show vendor"
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "display_collections",
|
||||
"label": "Show collections"
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "display_social_buttons",
|
||||
"label": "Show social media share icons",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"type": "radio",
|
||||
"id": "product_description_position",
|
||||
"label": "Description position",
|
||||
"options": [
|
||||
{
|
||||
"value": "top",
|
||||
"label": "Above 'add to cart'"
|
||||
},
|
||||
{
|
||||
"value": "bottom",
|
||||
"label": "Below 'add to cart'"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "radio",
|
||||
"id": "product_images_position",
|
||||
"label": "Images position",
|
||||
"options": [
|
||||
{
|
||||
"value": "left",
|
||||
"label": "Left"
|
||||
},
|
||||
{
|
||||
"value": "right",
|
||||
"label": "Right"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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)"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
{% endschema %}
|
||||
Reference in New Issue
Block a user