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() and product.hasPrice(customerMgr.priceContext) %}
  44. {% set country = customerMgr.getCustomerCountry() %}
  45. {% if product.isAvailableForCountry(country) %}
  46. {% if customerMgr.isExpert() %}
  47. {% if not product.isGift() %}
  48. <div class="price-ctn cf">
  49. {% if product.hasChildren() and product.getFromPrice(true, priceGroup, true) %}
  50. <div class="from-price">
  51. <span class="from">{% trans %}A partir de :{% endtrans %}</span>
  52. <span class="price">{{ product.getFromPrice(true, priceGroup)|price }}</span>
  53. </div>
  54. <span class="price-tax-incl">{{ product.getFromPrice(true, priceGroup, true)|price }}<sup>{{ 'ttc' | trans }}</sup></span>
  55. {% else %}
  56. <span class="price">{{ product.getPrice(true, priceGroup)|price }}</span>
  57. <span class="price-tax-incl">{{ product.getPrice(true, priceGroup, true)|price }}<sup>{{ 'ttc' | trans }}</sup></span>
  58. {% endif %}
  59. </div>
  60. {% endif %}
  61. {% else %}
  62. {% set normalPrice = product.getPrice(false, priceGroup) %}
  63. {% set reducedPrice = priceMgr.getPrice(product, 1, false) %}
  64. <div class="price-ctn cf">
  65. {% if product.hasChildren() and product.getFromPrice(true, priceGroup) %}
  66. <span class="from">{% trans %}A partir de :{% endtrans %}</span>
  67. <span class="price">{{ product.getFromPrice(true, priceGroup)|price }}</span>
  68. {% elseif product.getPrice(false, priceGroup) %}
  69. {% if reducedPrice < normalPrice %}
  70. <span class="price old-price">{{ normalPrice|price }}</span>
  71. <span class="price reduced-price">{{ reducedPrice|price }}</span>
  72. {% else %}
  73. <span class="price">{{ normalPrice|price }}</span>
  74. {% endif %}
  75. {% endif %}
  76. </div>
  77. {% if discounts is defined and discounts and product.price %}
  78. {% if product.id in discounts|keys %}
  79. <div class="discount">
  80. {{ attribute(discounts,product.id) }}
  81. </div>
  82. {% elseif reducedPrice!=normalPrice %}
  83. <div class="discount">
  84. {% trans %}Remise de{% endtrans %} {{ (((reducedPrice-normalPrice) / normalPrice) * 100) | percent }}
  85. </div>
  86. {% endif %}
  87. {% endif %}
  88. {% endif %}
  89. {% endif %}
  90. {% endif %}
  91. {% if productItemFooter is defined and productItemFooter %}
  92. {{ productItemFooter|raw }}
  93. {% endif %}
  94. </li>