v1/web/themes/custom/martis/templates/commerce/commerce-product.html.twig

101 lines
3.5 KiB
Twig

{#
/**
* @file
*
* Default product template.
*
* Available variables:
* - attributes: HTML attributes for the wrapper.
* - product: The rendered product fields.
* Use 'product' to print them all, or print a subset such as
* 'product.title'. Use the following code to exclude the
* printing of a given field:
* @code
* {{ product|without('title') }}
* @endcode
* - product_entity: The product entity.
* - product_url: The product URL.
*
* @ingroup themeable
*/
#}
{%
set classes = [
'product-post',
]
%}
{% if product_image_effect == "product-image-colorbox" %}
{{ attach_library('martis/product-colorbox') }}
{% endif %}
<div{{ attributes.addClass(classes) }}>
<div class="row">
<div class="col-md-6 product-image-wrap {{ product_image_effect }}">
<div class="product-image-full-wrap">
<div class="product-image-full">{{ product.variation_field_image }}</div>
</div>
<div class="piczoomer"></div>
<div class="piclist"></div>
</div>
<div class="col-md-6 product-content-wrap">
<div class="product-title">{{ product.variation_title }}</div>
<div class="product-ratings">{{ product.field_ratings }}</div>
<div class="product-price-wrap">
<div class="product-price">{{ product.variation_price }}</div>{% if product.variation_list_price|render|striptags|trim %} <del class="product-old-price">{{ product.variation_list_price }}</del>{% endif %}
</div>
<div class="clearfix product-stock">
<div class="field-label stock-availability">{{'Availability:'|t}}</div>
<div class="available-stock">{{'In stock'|t}}</div>
<div class="out-of-stock">{{'Out of stock'|t}}</div>
{# {{ product.variation_field_stock_level }} #}
</div>
<div class="product-short-description">{{ product.field_short_description }}</div>
<div class="product-meta">
<div class="product-meta-item product-sku">{{ product.variation_sku }}</div>
<div class="product-meta-item product-brand">{{ product.field_product_brand }}</div>
<div class="product-meta-item product-category">{{ product.field_product_category }}</div>
</div>
<div class="product-variation-wrap clearfix">
<div class="product-add-cart">{{ product.variations }}</div>
</div>
<div class="product-meta">
<div class="product-icon-wrap">
<div class="product-icon product-add-wishlist">{{ product.flag_wishlist }}</div>
<div class="product-icon product-add-compare">{{ product.flag_compare }}</div>
</div>
</div>
{{- product|without('variation_attributes','variation_price','variation_list_price','variation_title','variations','field_short_description','variation_field_image','variation_sku','variation_field_stock_level','field_product_review','body','field_product_brand','field_product_category','flag_wishlist','flag_compare','field_badge','field_special_category','field_ratings') -}}
</div>
</div>
<div class="margin-top-50 product-info clearfix">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#product-detail">{{ 'Description'|t }}</a></li>
<li><a data-toggle="tab" href="#product-review">{{ 'Reviews'|t }}</a></li>
</ul>
<div class="tab-content">
<div id="product-detail" class="tab-pane active">
<div class="product-tab-item">
<h2 class="margin-bottom-20">{{ 'Product Description'|t }}</h2>
<div>{{ product.body }}</div>
</div>
</div>
<div id="product-review" class="tab-pane fade">
{{ product.field_product_review }}
</div>
</div>
</div>
</div>