presto-8.x-2.2/themes/presto_theme/templates/commerce/commerce-product--default.html.twig
themes/presto_theme/templates/commerce/commerce-product--default.html.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 images = product_entity.field_images %}
{% set thumbnail = product_entity.field_thumbnail %}
{% set view_mode = product.title['#view_mode'] %}
<div class="product product-item">
<div class="product-listing-wrapper card">
{% if product.field_regular_price|render|striptags|trim != '' %}
<a class="on-sale-tag" href="{{ product_url }}">
<span class="onsale">Sale!</span>
</a>
{% endif %}
{% if thumbnail.entity.fileuri %}
<div class="product-listing-action-wrapper">
<div class="add-to-cart-wrapper">
<a class="add-to-cart" data-action="cart">
<i class="fa fa-2x fa-fw fa-shopping-cart"></i>
<span>Quick Add to Cart</span>
</a>
</div>
<div class="view-details-wrapper">
<a href="{{ product_url }}" title="View details for {{ product.title|render|striptags|trim }}">
<i class="fa fa-2x fa-fw fa-list"></i>
View Details
</a>
</div>
<div class="thumbnail-wrapper">
<img alt="" class="img-responsive" src="{{ file_url(thumbnail.entity.fileuri) }}">
</div>
</div>
{% endif %}
<div class="product-list-info-wrapper card-header">
<a href="{{ product_url }}">
<h4 class="card-title">{{ product.title|render|striptags|trim }}</h4>
<h5>[ {{ product.variation_sku|render|striptags|trim }} ]</h5>
<span class="price">
<span class="current-price amount">{{ product.variation_price }}</span>
{% if product.field_regular_price|render|striptags|trim != '' %}
<span class="regular-price amount">
( Was: <del>{{ product.field_regular_price }}</del> )
</span>
{% endif %}
</span>
</a>
</div>
<div class="variations-wrapper card-body">
{{ product.variations }}
</div>
</div>
</div>
