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 }}" data-mid="{{ model.code }}">
  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. {# image de la déclinaison affichée, à défaut d'une déclinaison de la même entrée, puis du modèle #}
  18. {% set picture = model.getListingPicture(product) %}
  19. {% if picture %}
  20. <img src="{{ asset(picture.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. {% set productUrl = product_path(product) %}
  34. {% set productTitle = model.name %}
  35. {% set axisLabel = model ? product.listingAxisLabel : null %}
  36. {% if axisLabel %}
  37. {% set modelDescription = model.getProductModelDescription(app.request.locale) %}
  38. {% if modelDescription and modelDescription.name %}
  39. {% set productTitle = modelDescription.name ~ ' - ' ~ axisLabel %}
  40. {% endif %}
  41. {% endif %}
  42. <{{ productTitleTag }} class="title"><a href="{{ productUrl }}">{{ productTitle|excerpt(60,'') | raw }}</a></{{ productTitleTag }}>
  43. {% if customerMgr.canSeePrices() and product.hasPrice(customerMgr.priceContext) %}
  44. {% set country = customerMgr.getCustomerCountry() %}
  45. {% if product.isAvailableForCountry(country) %}
  46. {# prix calculés sur les seules déclinaisons de cette entrée de listing (ex. même couleur) #}
  47. {% set fromPrice = model.getFromPrice(true, priceGroup, false, product) %}
  48. {% set fromPriceVat = model.getFromPrice(true, priceGroup, true, product) %}
  49. {% set severalVariants = model.getListingProducts(product)|length > 1 %}
  50. {% if customerMgr.isExpert() %}
  51. {% if not product.isGift() %}
  52. <div class="price-ctn cf">
  53. {% if severalVariants and fromPriceVat %}
  54. <div class="from-price">
  55. <span class="from">{% trans %}A partir de :{% endtrans %}</span>
  56. <span class="price">{{ fromPrice|price }}</span>
  57. </div>
  58. <span class="price-tax-incl">{{ fromPriceVat|price }}<sup>{{ 'ttc' | trans }}</sup></span>
  59. {% else %}
  60. <span class="price">{{ fromPrice|price }}</span>
  61. <span class="price-tax-incl">{{ fromPriceVat|price }}<sup>{{ 'ttc' | trans }}</sup></span>
  62. {% endif %}
  63. </div>
  64. {% endif %}
  65. {% else %}
  66. <div class="price-ctn cf">
  67. {% if fromPrice %}
  68. {% if severalVariants %}
  69. <span class="from">{% trans %}A partir de :{% endtrans %}</span>
  70. {% endif %}
  71. <span class="price">{{ fromPrice|price }}</span>
  72. {% endif %}
  73. </div>
  74. {% endif %}
  75. {% endif %}
  76. {% endif %}
  77. {% if productItemFooter is defined and productItemFooter %}
  78. {{ productItemFooter|raw }}
  79. {% endif %}
  80. </li>