templates/front/catalog/model/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. {% if product.pictures|length > 0 %}
  18. <img src="{{ asset(attribute(product.pictures,0).webPath) | imagine_filter('product_medium') }}" width="300" height="300" alt="{{ product.name }}">
  19. {% elseif product.parent and product.parent.pictures|length > 0 %}
  20. <img src="{{ asset(attribute(product.parent.pictures,0).webPath) | imagine_filter('product_medium') }}" width="300" height="300" alt="{{ product.name }}">
  21. {% else %}
  22. <img src="{{ asset('img/img-default.png') | imagine_filter('product_medium') }}" width="300" height="300" alt="{{ product.name }}">
  23. {% endif %}
  24. </div>
  25. <div class="manufacturer">
  26. {% if product.manufacturer %}
  27. {% set slug = product.manufacturer.getUrl(app.request.locale) %}
  28. <a href="{{ path('manufacturer',{id:product.manufacturer.id,url:slug}) }}">
  29. {{ product.manufacturer.name }}
  30. </a>
  31. {% endif %}
  32. </div>
  33. {% if product.hasParent() %}
  34. {% set productUrl = path('product',{id:product.parent.id,url:product.parent.url}) %}
  35. {% else %}
  36. {% set productUrl = path('product',{id:product.id,url:product.url}) %}
  37. {% endif %}
  38. <{{ productTitleTag }} class="title"><a href="{{ productUrl }}">{{ product.name|excerpt(60,'') }}</a></{{ productTitleTag }}>
  39. {% if customerMgr.canSeePrices() and product.hasPrice(customerMgr.priceContext) %}
  40. {% set country = customerMgr.getCustomerCountry() %}
  41. {% if product.isAvailableForCountry(country) %}
  42. {% if customerMgr.isExpert() %}
  43. {% if not product.isGift() %}
  44. <div class="price-ctn cf">
  45. {% if product.hasChildren() and product.getFromPrice(true, priceGroup, true) %}
  46. <div class="from-price">
  47. <span class="from">{% trans %}A partir de :{% endtrans %}</span>
  48. <span class="price">{{ product.getFromPrice(true, priceGroup)|price }}</span>
  49. </div>
  50. <span class="price-tax-incl">{{ product.getFromPrice(true, priceGroup, true)|price }}<sup>{{ 'ttc' | trans }}</sup></span>
  51. {% else %}
  52. <span class="price">{{ product.getPrice(true, priceGroup)|price }}</span>
  53. <span class="price-tax-incl">{{ product.getPrice(true, priceGroup, true)|price }}<sup>{{ 'ttc' | trans }}</sup></span>
  54. {% endif %}
  55. </div>
  56. {% endif %}
  57. {% else %}
  58. {% set normalPrice = product.getPrice(false, priceGroup) %}
  59. {% set reducedPrice = priceMgr.getPrice(product, 1, false) %}
  60. <div class="price-ctn cf">
  61. {% if product.hasChildren() and product.getFromPrice(true, priceGroup) %}
  62. <span class="from">{% trans %}A partir de :{% endtrans %}</span>
  63. <span class="price">{{ product.getFromPrice(true, priceGroup)|price }}</span>
  64. {% elseif product.getPrice(false, priceGroup) %}
  65. {% if reducedPrice < normalPrice %}
  66. <span class="price old-price">{{ normalPrice|price }}</span>
  67. <span class="price reduced-price">{{ reducedPrice|price }}</span>
  68. {% else %}
  69. <span class="price">{{ normalPrice|price }}</span>
  70. {% endif %}
  71. {% endif %}
  72. </div>
  73. {% if discounts is defined and discounts and product.price %}
  74. {% if product.id in discounts|keys %}
  75. <div class="discount">
  76. {{ attribute(discounts,product.id) | raw }}
  77. </div>
  78. {% elseif reducedPrice!=normalPrice %}
  79. <div class="discount">
  80. {% trans %}Remise de{% endtrans %} {{ (((reducedPrice-normalPrice) / normalPrice) * 100) | percent }}
  81. </div>
  82. {% endif %}
  83. {% endif %}
  84. {% endif %}
  85. {% endif %}
  86. {% endif %}
  87. {% if productItemFooter is defined and productItemFooter %}
  88. {{ productItemFooter|raw }}
  89. {% endif %}
  90. </li>