custom/src/EshopBundle/Resources/views/component/product/list/box/default.html.twig line 52

Open in your IDE?
  1. {% set id = product.getId() %}
  2. {% set name = product.getName() %}
  3. {% set link = product.getLink() %}
  4. {% set annot = product.getAnnotation() | striptags %}
  5. {% set price = price_calculator.calculate(product) %}
  6. {% set availability = availability.get(product) %}
  7. <div class="productList__item col-xs-12 col-md-{{ colSize }}">
  8.     <div class="productList__inner">
  9.         <a class="productList__img block cf" href="{{ link }}" title="{{ name }}" data-gtm="{{ product.getGtmId() }}">
  10.             <img src="{{ product.getImageUri('m') }}" alt="{{ name }}">
  11.             {% include 'component/product/list/labels.html.twig' with { price: price, product: product} %}
  12.         </a>
  13.         {% include 'component/product/common/rating/stars.html.twig' with { 'stars': product.getUserRatingStars(), 'rating': product.getUserRating() } %}
  14.         <h3 class="productList__title"><a href="{{ link }}" title="{{ name }}" data-gtm="{{ product.getGtmId() }}">{{ name | length > nameLength ? name | slice(0, nameLength) ~ '...' : name }}</a></h3>
  15.         <div class="productList__info cf">
  16.             <div class="productList__info__col price">
  17.             {% if price.excVat > 0.00 %}
  18.                 {# Bezna cena #}
  19.                 {% set priceToCompare = settings.priceIncVat ? price.incVat : price.excVat %}
  20.                 {% if price.rrp is defined and price.rrp > 0 and price.rrp > priceToCompare and not (product.getTypes and product.getVariant|length) %}
  21.                     <small class="price price--comPrice">
  22.                     {% if category.getDecimalPricesStatus() %}
  23.                         {{ currency.formatCustom(price.rrp)|raw }}
  24.                     {% else %}
  25.                         {{ currency.format(price.rrp)|raw }}
  26.                     {% endif %}
  27.                     </small>
  28.                 {% endif %}
  29.                 {# Cena s a bez DPH #}
  30.                 {% if settings.priceIncVat %}
  31.                     {% if category.getDecimalPricesStatus() %}
  32.                         <strong class="price price--incVat">{{ currency.formatCustom(price.incVat)|raw }}</strong>
  33.                         {% if settings.listPriceExtended %}
  34.                             <div class="price price--excVat">{{ currency.formatCustom(price.excVat)|raw }} {{ translator.getValue('BEZ_DPH') }}</div>
  35.                         {% endif %}
  36.                     {% else %}
  37.                         <strong class="price price--incVat">{{ currency.format(price.incVat)|raw }}</strong>
  38.                         {% if settings.listPriceExtended %}
  39.                             <div class="price price--excVat">{{ currency.format(price.excVat)|raw }} {{ translator.getValue('BEZ_DPH') }}</div>
  40.                         {% endif %}
  41.                     {% endif %}
  42.                 {% else %}
  43.                     {% if category.getDecimalPricesStatus() %}
  44.                         <strong class="price price--incVat">{{ currency.formatCustom(price.excVat)|raw }}</strong> {{ translator.getValue('BEZ_DPH', 'bez DPH') }}{# EJ V080601 11.10.2021 #}
  45.                         {% if settings.listPriceExtended %}
  46.                             <div class="price price--excVat">{{ currency.formatCustom(price.incVat)|raw }}  {{ translator.getValue('S_DPH') }}</div>
  47.                         {% endif %}
  48.                     {% else %}
  49.                         <strong class="price price--incVat">{{ currency.format(price.excVat)|raw }}</strong> {{ translator.getValue('BEZ_DPH', 'bez DPH') }}{# EJ V080601 11.10.2021 #}
  50.                         {% if settings.listPriceExtended %}
  51.                             <div class="price price--excVat">{{ currency.format(price.incVat)|raw }}  {{ translator.getValue('S_DPH') }}</div>
  52.                         {% endif %}
  53.                     {% endif %}
  54.                 {% endif %}
  55.             {% else %}
  56.                 <strong class="price price--incVat">{{ translator.getValue('NA_DOTAZ', 'Na dotaz') }}</strong>
  57.             {% endif %}
  58.             </div>
  59.             <div class="productList__info__col action">
  60.                 {% if partner_config.getAllowListBuy and product.getPrice > 0 %} {# DS 2021-06-28 V078926 nákup z listu jen pokud má produkt cenu #}
  61.                     {% if product.getTypes and product.getVariant|length %}
  62.                         <a href="{{ link }}" title="{{ name }}" class="btn btn-primary btn-detail pull-right" data-gtm="{{ product.getGtmId() }}">{{ translator.getValue('DETAIL') }}</a>
  63.                     {% else %}
  64.                         {# DONE: includnout sablonu jednoducheho nakupnho formu, zbytek by mel fungovat automaticky #}
  65.                         {% include 'component/product/common/purchase_form/list.html.erb' with { product: product } %}
  66.                         {# <a href="{{ link }}" title="{{ name }}" class="buyable btn btn-primary btn-detail pull-right">{{ translator.getValue('PRODUCT_TYPE_BUY') }}</a> #}
  67.                     {% endif %}
  68.                 {% else %}
  69.                     <a href="{{ link }}" title="{{ name }}" class="btn btn-primary btn-detail pull-right" data-gtm="{{ product.getGtmId() }}">{{ translator.getValue('DETAIL') }}</a>
  70.                 {% endif %}
  71.             </div>
  72.         </div>
  73.         {# Dostupnost produktu + porovnani #}
  74.         <div class="productList__avail">
  75.             {% if enableCompare %}
  76.                 {% if comparator.hasProduct(id) %}
  77.                     <div class="productList__avail__col bg-compare">
  78.                         <a class="compare" data-compare="1" href="/_product-compare/toggle/{{ product.getId() }}" title="{{ translator.getValue('REMOVE_FROM_COMPARE') }}">
  79.                             <i class="icon-compare"></i> {{ translator.getValue('POROVNANI') }}
  80.                         </a>
  81.                     </div>
  82.                 {% else %}
  83.                     <div class="productList__avail__col">
  84.                         <a class="compare" data-compare="1" href="/_product-compare/toggle/{{ product.getId() }}" title="{{ translator.getValue('ADD_TO_COMPARE') }}">
  85.                             <i class="icon-compare"></i> {{ translator.getValue('POROVNANI') }}
  86.                         </a>
  87.                     </div>
  88.                 {% endif %}
  89.             {% endif %}
  90.             <div class="productList__avail__col">
  91.                 {% if product.getTypes|length %}
  92.                     {% include 'component/product/common/availability/avail-types.html.twig' %}
  93.                 {% else %}
  94.                     {% include 'component/product/common/availability/avail-basic.html.twig' %}
  95.                 {% endif %}
  96.             </div>
  97.         </div>
  98.         {% autoescape false %}
  99.             <div class="productList__desc">{{ annot | length > annotLength ? annot | slice(0, annotLength) ~ '...' : annot }}</div>
  100.         {% endautoescape %}
  101.     </div>
  102. </div>