themes/webapicTheme/templates/products/single_product_fabric.html.twig line 1

Open in your IDE?
  1. {% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
  2. {% if product.imagesByType('image_product_secondary') is not empty %}
  3.     {% set source_path = product.imagesByType('image_product_secondary').first.path %}
  4.     {% set path = source_path|imagine_filter('app_product_fabric_small_thumbnail_listing') %}
  5. {% elseif product.images.first %}
  6.     {% set source_path = product.images.first.path %}
  7.     {% set path = source_path|imagine_filter('app_product_fabric_small_thumbnail_listing') %}
  8. {% else %}
  9.     {% set path = asset('webapic-theme/images/icon-gmap.png') %}
  10. {% endif %}
  11. <div class="listing1-product-ctn card tissu">
  12.     {% include 'partials/block-add-to-wishlist.html.twig' with {'product': product} %}
  13.     <a href="{{ path('app_product_variant_show', {'slug': product.slug, 'id': product.id}) }}" class="">
  14.         <div class="img-ctn">
  15.             <div class="flag">
  16.                 {% include 'partials/block-callout.html.twig' with {'callout': product.badge} only %}
  17.             </div>
  18.             <div class="img-ctn-content">
  19.                 <img class="lazy" data-src="{{ path }}" id="main-image" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }} />
  20.             </div>
  21.         </div>
  22.         <div class="title">{{ product.name }}</div>     
  23.         {% set price = money.calculatePrice(product) %}
  24.         {% set originalPrice = money.calculateOriginalPrice(product) %}
  25.         {% spaceless %}
  26.         <div class="sylius-product-price price" {{ sylius_test_html_attribute('product-price') }}>
  27.             {% if product.product.conditioning == 'per_meter_each_0_5_meter' %}
  28.             {{ price }}/m
  29.             {% elseif product.product.conditioning == 'card_kdo_per_euros_each_10_euros' %}
  30.                 {{ 'app.front.listing.product.from'|trans }} 10€
  31.             {% else %}
  32.             {{ price }}
  33.             {% endif %}
  34.         </div>
  35.         {% endspaceless %}
  36.     </a>
  37. </div>