templates/article/articleCard.html.twig line 1

Open in your IDE?
  1. <div class="card h-100 borderWebshop">
  2.     <a class="text-center" href="{{ articlePath|replace({'article.id': article.id})  }}">
  3.         {% if article.image %}
  4.             <img class="imgArticle" src="/image/article/{{ article.image }}"
  5.                  alt="article{{ article.id }}">
  6.         {% else %}
  7.             <img class="imgArticle" src="{{ asset('image/article/default.jpg') }}"
  8.                  alt="article{{ article.id }}">
  9.         {% endif %}
  10.     </a>
  11.     <div class="card-body">
  12.         <div class="row">
  13.             <div class="col-12">
  14.                 <h4 class="card-title regularSubtitle text-center">
  15.                     <a href="{{ articlePath|replace({'article.id': article.id})  }}">{{ article.name }}</a>
  16.                 </h4>
  17.                 {% if article.prePackaged is defined %}
  18.                         <p class="text-center">{{ article.prePackaged }}</p>
  19.                 {% endif %}
  20.                 <hr>
  21.             </div>
  22.         </div>
  23.         <div class="bodyText text-center">
  24.             <p>{{ article.description }}</p>
  25.         </div>
  26.         <div class="row align-items-center align-middle">
  27.             {% if app.user %}
  28.                 <div class="col-6 text-center">
  29.                     <a class="btn icon-add" href="{{ articlePath|replace({'article.id': article.id})  }}"></a>
  30.                 </div>
  31.                 <div class="col-6">
  32.                     <div class="d-inline">
  33.                         <input type="number" id="qty{{ article.id }}"
  34.                                onchange="checkMaxQty({{ article.id }}, {{ article.maxQty }})" min="1" max="99"
  35.                                value="1">
  36.                         <span> pcs &nbsp;</span>
  37.                     </div>
  38.                     <div class="d-inline">
  39.                         <button class="btn icon-cart-red"
  40.                                 data-toggle="popover" data-trigger="hover"
  41.                                 data-content="{{ "article.addArticle" | trans }}"
  42.                                 onclick="addOrderArticle({{ article.id }})">
  43.                         </button>
  44.                     </div>
  45.                 </div>
  46.             {% else %}
  47.                 <div class="col-12 text-center">
  48.                     <a class="btn icon-add" href="{{ articlePath|replace({'article.id': article.id})  }}"></a>
  49.                 </div>
  50.             {% endif %}
  51.         </div>
  52.         {% if app.user %}
  53.             <div class="row">
  54.                 <hr class="hrDark">
  55.                 <div class="col-12">
  56.                     {% if article.price.salePrice is defined %}
  57.                         {% if article.price.salePrice > article.price.salePricePromo %}
  58.                             <h4 class="text-center textPrice">
  59.                                 <span class="promo">{{ article.price.salePrice|number_format(2) }}€</span>
  60.                                 <span style="color:green">{{ article.price.salePricePromo|number_format(2) }}€{% if article.isVaryingWeight %} /kg {% endif %}</span>
  61.                             </h4>
  62.                         {% else %}
  63.                             <h4 class="text-center textPrice">{{ article.price.salePricePromo|number_format(2) }}
  64.                                 € {% if article.isVaryingWeight %} /kg {% endif %}</h4>
  65.                         {% endif %}
  66.                     {% else %}
  67.                         <h4 class="text-center textPrice ">{{ article.price|number_format(2) }} €
  68.                             {% if article.isVaryingWeight %} /kg {% endif %}</h4>
  69.                     {% endif %}
  70.                 </div>
  71.             </div>
  72.         {% endif %}
  73.     </div>
  74. </div>