first commit
This commit is contained in:
@@ -0,0 +1,187 @@
|
|||||||
|
{% assign variant = product.selected_or_first_available_variant %}
|
||||||
|
|
||||||
|
{% liquid
|
||||||
|
comment
|
||||||
|
Yagi automatic discount helper app code
|
||||||
|
endcomment
|
||||||
|
assign product_price = product.metafields.app--168074346497.min_auto_discounted_price.value | default: product.price
|
||||||
|
assign product_price_min = product_price
|
||||||
|
assign product_price_max = product.price_max
|
||||||
|
assign product_compare_at_price = product.compare_at_price
|
||||||
|
assign product_compare_at_price_min = product.compare_at_price
|
||||||
|
assign product_compare_at_price_max = product.compare_at_price_max
|
||||||
|
|
||||||
|
if product.metafields.app--168074346497.discount_percentage.value > 0.01
|
||||||
|
assign deducted_percentage = 1.0 | minus: product.metafields.app--168074346497.discount_percentage.value
|
||||||
|
|
||||||
|
assign product_price = product.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil
|
||||||
|
assign product_price_min = product_price
|
||||||
|
assign product_price_max = product.price_max | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil
|
||||||
|
|
||||||
|
assign product_compare_at_price = product.price
|
||||||
|
assign product_compare_at_price_max = product.price_max
|
||||||
|
|
||||||
|
if product.compare_at_price > product_compare_at_price
|
||||||
|
assign product_compare_at_price = product.compare_at_price
|
||||||
|
assign product_compare_at_price_min = product_compare_at_price
|
||||||
|
endif
|
||||||
|
|
||||||
|
if product.compare_at_price_max > product_compare_at_price_max
|
||||||
|
assign product_compare_at_price_max = product.price_max
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
<div class="product-details">
|
||||||
|
<span class="title" itemprop="name">
|
||||||
|
{{- product.title | escape -}}
|
||||||
|
</span>
|
||||||
|
{% if settings.display_vendor %}
|
||||||
|
<span class="brand">
|
||||||
|
{{ product.vendor }}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if settings.show_star_ratings and product.metafields.reviews.rating.value != blank %}
|
||||||
|
<div class="product-rating">
|
||||||
|
{%
|
||||||
|
render 'rating-stars',
|
||||||
|
value: product.metafields.reviews.rating.value.rating,
|
||||||
|
scale_max: product.metafields.reviews.rating.value.scale_max,
|
||||||
|
%}
|
||||||
|
<p class="rating__text">
|
||||||
|
<span aria-hidden="true">{{ product.metafields.reviews.rating.value }} / {{ product.metafields.reviews.rating.value.scale_max }}</span>
|
||||||
|
</p>
|
||||||
|
<p class="rating__count">
|
||||||
|
<span aria-hidden="true">({{ product.metafields.reviews.rating_count }})</span>
|
||||||
|
<span class="visually-hidden">{{ product.metafields.reviews.rating_count }} {{ "general.accessibility.total_reviews" | t }}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if collection_handles contains 'coming-soon' %}
|
||||||
|
<span class="coming-soon">{{ 'collections.general.coming_soon' | t }}</span>
|
||||||
|
{% else %}
|
||||||
|
{% if settings.quick_shop_enabled and settings.quick_shop_style == 'inline' %}
|
||||||
|
{% comment %}Inject @pixelunion/shopify-price-ui/price-ui begin{% endcomment %}
|
||||||
|
<div class="price-ui price-ui--loading" data-price-ui>
|
||||||
|
<noscript>
|
||||||
|
<style>
|
||||||
|
.price-ui--loading {
|
||||||
|
display: block !important;
|
||||||
|
opacity: 1 !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</noscript>
|
||||||
|
{% assign compare_at_price = false %}
|
||||||
|
|
||||||
|
{% if product_compare_at_price and product_compare_at_price != product_price %}
|
||||||
|
{% if product.compare_at_price_varies %}
|
||||||
|
{%- capture price_min -%}
|
||||||
|
{%-
|
||||||
|
render 'price-ui-templates',
|
||||||
|
template: 'price-min',
|
||||||
|
value: product_compare_at_price_min,
|
||||||
|
-%}
|
||||||
|
{%- endcapture -%}
|
||||||
|
|
||||||
|
{%- capture price_max -%}
|
||||||
|
{%-
|
||||||
|
render 'price-ui-templates',
|
||||||
|
template: 'price-max',
|
||||||
|
value: product_compare_at_price_max,
|
||||||
|
-%}
|
||||||
|
{%- endcapture -%}
|
||||||
|
|
||||||
|
{%- assign compare_at_price = 'product.price.range_html' | t: price_min: price_min, price_max: price_max -%}
|
||||||
|
{% else %}
|
||||||
|
{%- capture compare_at_price -%}
|
||||||
|
{%-
|
||||||
|
render 'price-ui-templates',
|
||||||
|
template: 'price',
|
||||||
|
value: product_compare_at_price,
|
||||||
|
-%}
|
||||||
|
{%- endcapture -%}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if product.price_varies %}
|
||||||
|
{%- capture price_min -%}
|
||||||
|
{%-
|
||||||
|
render 'price-ui-templates',
|
||||||
|
template: 'price-min',
|
||||||
|
value: product_price_min,
|
||||||
|
-%}
|
||||||
|
{%- endcapture -%}
|
||||||
|
|
||||||
|
{%- capture price_max -%}
|
||||||
|
{%-
|
||||||
|
render 'price-ui-templates',
|
||||||
|
template: 'price-max',
|
||||||
|
value: product_price_max,
|
||||||
|
-%}
|
||||||
|
{%- endcapture -%}
|
||||||
|
|
||||||
|
{%- assign price = 'product.price.range_html' | t: price_min: price_min, price_max: price_max -%}
|
||||||
|
{% else %}
|
||||||
|
{%- capture price -%}
|
||||||
|
{%-
|
||||||
|
render 'price-ui-templates',
|
||||||
|
template: 'price',
|
||||||
|
value: product_price,
|
||||||
|
-%}
|
||||||
|
{%- endcapture -%}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{%-
|
||||||
|
render 'price-ui-templates',
|
||||||
|
template: 'price-ui',
|
||||||
|
compare_at_price: compare_at_price,
|
||||||
|
price: price,
|
||||||
|
unit_pricing: false,
|
||||||
|
-%}
|
||||||
|
</div>
|
||||||
|
{% comment %}Inject @pixelunion/shopify-price-ui/price-ui end{% endcomment %}
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
<span class="price {% if product_compare_at_price > product_price %}sale{% endif %}">
|
||||||
|
{% unless product.available == false and settings.display_price == false %}
|
||||||
|
<span class="current_price">
|
||||||
|
{% if product.price_varies %}
|
||||||
|
<small class="from"><em>{{ 'products.general.from' | t }}</em></small>
|
||||||
|
{% endif %}
|
||||||
|
{% if product.price_min > 0 %}
|
||||||
|
<span class="money">{% render 'price-element', price: product_price_min %}</span>
|
||||||
|
{% else %}
|
||||||
|
{% if settings.free_price_text != blank %}
|
||||||
|
<span class="free">{{ settings.free_price_text }}</span>
|
||||||
|
{% else %}
|
||||||
|
<span class="money">{% render 'price-element', price: product_price_min %}</span>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
<span class="was_price">
|
||||||
|
{% if product_price < product_compare_at_price %}
|
||||||
|
<span class="money">{% render 'price-element', price: product_compare_at_price %}</span>
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
{% endunless %}
|
||||||
|
<div class="sold_out">
|
||||||
|
{% unless product.available %}
|
||||||
|
{{ 'products.product.sold_out' | t }}
|
||||||
|
{% endunless %}
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% if settings.quick_shop_enabled and settings.quick_shop_style == 'popup' %}
|
||||||
|
{%
|
||||||
|
render 'unit-price',
|
||||||
|
item: variant,
|
||||||
|
variant: product,
|
||||||
|
product: product,
|
||||||
|
class: 'product-details__unit-price'
|
||||||
|
%}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user