{#
/**
 * @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 = [
  'commerce-product',
  'commerce-product--' ~ product_entity.bundle|clean_class,
  'commerce-product--teaser',
  elements['#view_mode'] ? 'commerce-product--view-mode-' ~ elements['#view_mode']|clean_class,
  'clearfix',
]
%}

<div {{ attributes.addClass(classes) }}>
  <div{{ content_attributes.addClass('commerce-product__content', 'clearfix') }}>
    <a href="{{ product_url }}" rel="bookmark">
      {{ main_image }}
      <div class="commerce-product-teaser-content">
        {{ title_prefix }}
        <h2{{ title_attributes.addClass('commerce-product__title') }}>
          {% set title %}
            {{ product.title }}
          {% endset %}
          {{ title|render|striptags|trim }}
        </h2>
        {{ title_suffix }}
      </div>
    </a>
    <div class="commerce-product__buy">
      {{ product.variation_price }}
      {{ product.variations }}
    </div>
  </div>
</div>
