templates/front/catalog/product/view/list-item.html.twig line 1

Open in your IDE?
  1. {% if productTitleTag is not defined %}
  2.     {% set productTitleTag = 'div' %}
  3. {% endif %}
  4. {% if priceGroup is not defined %}
  5.     {% set priceGroup = customerMgr.getPriceContext() %}
  6. {% endif %}
  7. <li class="product" data-pid="{{ product.id }}">
  8.     {% if removeBt is defined %}
  9.         <a class="{{ removeBt }}" data-product="{{ product.id }}">
  10.             <svg xmlns="http://www.w3.org/2000/svg" id="Calque_2" viewBox="0 0 11.25 11.05">
  11.                 <line style="fill:none;stroke:#000;stroke-miterlimit:10;" x1=".56" y1=".35" x2="10.9" y2="10.69"/>
  12.                 <line style="fill:none;stroke:#000;stroke-miterlimit:10;" x1="10.69" y1=".35" x2=".35" y2="10.69"/>
  13.             </svg>
  14.         </a>
  15.     {% endif %}
  16.     <div class="picture">
  17. {#        <div class="buttons">
  18.             {% include 'front/modules/wishlist/bt.html.twig' %}
  19.             {% include 'front/cart/bt.html.twig' %}
  20.         </div>#}
  21.         {% if product.pictures|length > 0 %}
  22.             <img src="{{ asset(attribute(product.pictures,0).webPath) | imagine_filter('product_medium') }}" width="300" height="300" alt="{{ product.name }}">
  23.         {% elseif product.parent and product.parent.pictures|length > 0 %}
  24.             <img src="{{ asset(attribute(product.parent.pictures,0).webPath) | imagine_filter('product_medium') }}" width="300" height="300" alt="{{ product.name }}">
  25.         {% else %}
  26.             <img src="{{ asset('img/img-default.png') | imagine_filter('product_medium') }}" width="300" height="300" alt="{{ product.name }}">
  27.         {% endif %}
  28.     </div>
  29.     <div class="manufacturer">
  30.         {% if product.manufacturer %}
  31.             {% set slug = product.manufacturer.getUrl(app.request.locale) %}
  32.             <a href="{{ path('manufacturer',{id:product.manufacturer.id,url:slug}) }}">
  33.                 {{ product.manufacturer.name }}
  34.             </a>
  35.         {% endif %}
  36.     </div>
  37.     {% if product.hasParent() %}
  38.         {% set productUrl = path('product',{id:product.parent.id,url:product.parent.url}) %}
  39.     {% else %}
  40.         {% set productUrl = path('product',{id:product.id,url:product.url}) %}
  41.     {% endif %}
  42.     <{{ productTitleTag }} class="title"><a href="{{ productUrl }}">{{ product.name|excerpt(60,'') }}</a></{{ productTitleTag }}>
  43.     {% if customerMgr.canSeePrices() %}
  44.         {% set country = customerMgr.getCustomerCountry() %}
  45.         {% if product.isAvailableForCountry(country) %}
  46.             {% set normalPrice = priceMgr.getPrice(product, 1, false) %}
  47.             {% set reducedPrice = priceMgr.getPrice(product, 1, false) %}
  48.             <div class="price-ctn cf">
  49.                 {% if product.hasChildren() and product.getFromPrice(true, priceGroup) %}
  50.                     <span class="from">{% trans %}A partir de :{% endtrans %}</span>
  51.                     <span class="price">{{ product.getFromPrice(true, priceGroup)|price }}</span>
  52.                 {% elseif product.getPrice(false, priceGroup) %}
  53.                     {% if reducedPrice < product.getPrice(true) %}
  54.                     <span class="price old-price">{{ normalPrice|price }}</span>
  55.                     <span class="price reduced-price">{{ reducedPrice|price }}</span>
  56.                     {% else %}
  57.                     <span class="price">{{ normalPrice|price }}</span>
  58.                     {% endif %}
  59.                 {% endif %}
  60.             </div>
  61.             {% if discounts is defined and discounts and product.price %}
  62.                 <div class="discount">
  63.                     {% if product.id in discounts|keys %}
  64.                         {{ attribute(discounts,product.id) }}
  65.                     {% else %}
  66.                         {% trans %}Remise de{% endtrans %} {{ (((reducedPrice-normalPrice) / normalPrice) * 100) | percent }}
  67.                     {% endif %}
  68.                 </div>
  69.             {% endif %}
  70.         {% endif %}
  71.     {% endif %}
  72.     {% if productItemFooter is defined and productItemFooter %}
  73.         {{ productItemFooter|raw }}
  74.     {% endif %}
  75. </li>