custom/src/EshopBundle/Resources/views/component/product/list/rows/default.html.twig line 250

Open in your IDE?
  1. {% set id       = product.getId() %}
  2. {% set name     = product.getName() %}
  3. {% set link     = product.getLink() %}
  4. {% set productCode = product.productCode() %}
  5. {% set stockMax = product.getStockMax() %}
  6. {% set price    = price_calculator.calculate(product) %}
  7. {% set availability = availability.get(product) %}
  8. {% if isDesignKutil() %}
  9.     {% set price = price_calculator.calculate(product) %}
  10.     <div class="productList__item{{ enableCompare and comparator.hasProduct(id) ? ' bg-compare' }}">
  11.         {% if enableCompare %}
  12.             {% if comparator.hasProduct(id) %}
  13.             <a class="compare active" data-compare="1" href="/_product-compare/toggle/{{ product.getId() }}" title="{{ translator.getValue('PRODUCT_COMPARE_TEXT', 'Porovnání produktu') }}">
  14.                 <i class="icon icon-compare"></i>
  15.             </a>
  16.             {% else %}
  17.             <a class="compare" data-compare="1" href="/_product-compare/toggle/{{ product.getId() }}" title="{{ translator.getValue('PRODUCT_COMPARE_TEXT', 'Porovnání produktu') }}">
  18.                     <i class="icon icon-compare"></i>
  19.                 </a>
  20.             {% endif %}
  21.         {% endif %}
  22.         <div class="productList__img">
  23.             {{ direct_edit(product) | raw }}
  24.             <img
  25.                 class="js-lazyload"
  26.                 src="{{ image_lazyload_placeholder }}"
  27.                 data-src="{{ product.getImageUri('s') }}"
  28.                 alt="{{ product.getImageAlt }}"
  29.             />
  30.         </div>
  31.         <div class="productList__content">
  32.             <a
  33.                 class="productList__title"
  34.                 href="{{ product.getLink() }}"
  35.                 title="{{ product.getName() }}"
  36.                 data-gtm="{{ product.getGtmId() }}"
  37.             >
  38.                 {{ product.getName() }}
  39.             </a>
  40.             <span class="productList__sku">
  41.                 {{ translator.getValue('PRODUCTS_SKU') }}
  42.                 <span>:</span>
  43.                 <span class="productList__sku__num">
  44.                     {{ product.getProductCode() }}
  45.                 </span>
  46.             </span>
  47.         </div>
  48.         <div class="productList__prices">
  49.             {% set unit =  product.getUnit is not null ? product.getUnit.getName : 'Ks'  %}
  50.             {% set priceInfo =  product.package(app.user) > 1 ? translator.getValue('PRICE_FOR_UNIT','cena za 1 %jednotka%') | replace({'%jednotka%' : unit }) : '' %}
  51.             {% if settings.priceIncVat %}
  52.                 {% if price.excVat > 0.00 %}
  53.                     <strong class="price price--incVat">
  54.                         {% if product.getVariant %}
  55.                             <span class="price__from">
  56.                                 {{ translator.getValue("CENA_OD", "od ") }}
  57.                             </span>
  58.                         {% endif %}
  59.                         {{ price.fIncVat | raw }}
  60.                         <span class="price-unit-info">
  61.                             {{ priceInfo }}
  62.                         </span>
  63.                     </strong>
  64.                     <span class="price price--excVat">
  65.                         {{ price.fExcVat | raw }}
  66.                         <span class="price-unit-info">
  67.                             {{ priceInfo }}
  68.                         </span>
  69.                     </span>
  70.                 {% else %}
  71.                     <span class="price">
  72.                         {{ translator.getValue('NENI_SKLADEM', 'Na dotaz') }}
  73.                     </span>
  74.                     <strong class="priceVat">
  75.                         {{ translator.getValue('NENI_SKLADEM', 'Na dotaz') }}
  76.                     </strong>
  77.                 {% endif %}
  78.             {% else %}
  79.                 <strong class="price price--incVat">
  80.                     {% if product.getVariant %}
  81.                         <span class="price__from">
  82.                             {{ translator.getValue("CENA_OD", "od ") }}
  83.                         </span>
  84.                     {% endif %}
  85.                     {{ price.fExcVat | raw }}
  86.                     <span class="price-unit-info">
  87.                         {{ priceInfo }}
  88.                     </span>
  89.                 </strong>
  90.                 <span class="price price--excVat">
  91.                     {{ price.fIncVat | raw }}
  92.                     <span class="price-unit-info">
  93.                         {{ priceInfo }}
  94.                     </span>
  95.                 </span>
  96.             {% endif %}
  97.             {% if product.getTypes | length and product.getVariant %}
  98.                 {% include 'component/product/common/availability/avail-types.html.twig' %}
  99.             {% else %}
  100.                 {% include 'component/product/common/availability/avail-basic.html.twig' %}
  101.             {% endif %}
  102.         </div>
  103.         <div class="productList__actions">
  104.             {% if partner_config.getAllowListBuy %}
  105.                 {% if product.getTypes | length and product.getVariant %}
  106.                     <a
  107.                         href="{{ product.getLink() }}"
  108.                         title="{{ product.getName() }}"
  109.                         class="btn btn-primary btn-detail pull-lg-right"
  110.                         data-gtm="{{ product.getGtmId() }}"
  111.                     >
  112.                         {{ translator.getValue('DETAIL') }}
  113.                     </a>
  114.                 {% else %}
  115.                     {% include 'component/product/common/purchase_form/list.html.erb' with { product: product } %}
  116.                 {% endif %}
  117.             {% else %}
  118.                 <a
  119.                     href="{{ product.getLink() }}"
  120.                     title="{{ product.getName() }}"
  121.                     class="btn btn-primary btn-detail pull-lg-right"
  122.                     data-gtm="{{ product.getGtmId() }}"
  123.                 >
  124.                     {{ translator.getValue('DETAIL') }}
  125.                 </a>
  126.             {% endif %}
  127.         </div>
  128.     </div>
  129. {% else %}
  130.     <tr>
  131.         {% if favorites is defined and favorites is same as (true) %}
  132.             <td class="image">
  133.                 <img class="js-lazyload" src="{{ image_lazyload_placeholder }}" data-src="{{ product.getImageUri('s') }}" alt="{{ product.getImageAlt }}">
  134.                 <noscript>
  135.                     <img src="{{ product.getImageUri('s') }}" alt="{{ product.getImageAlt }}">
  136.                 </noscript>
  137.             </td>
  138.         {% else %}
  139.             {% if isDesignButterfly() %}
  140.                 <td class="image">
  141.                     <img class="js-lazyload" src="{{ image_lazyload_placeholder }}" data-src="{{ product.getImageUri('s') }}" alt="{{ product.getImageAlt }}">
  142.                     <noscript>
  143.                         <img src="{{ product.getImageUri('s') }}" alt="{{ product.getImageAlt }}">
  144.                     </noscript>
  145.                 </td>
  146.             {% endif %}
  147.         {% endif %}
  148.         {# ID produktu #}
  149.         <td data-attr-prodSku="{{ translator.getValue('PRODUCTS_SKU') }}" class="sku text-xs-center">{{ direct_edit(product) | raw }}{{ productCode }}</td>
  150.         {# Nazev produktu #}
  151.         <td data-attr-prodTitle="{{ translator.getValue('NAZEV') }}" class="title">
  152.             <a class="productList__title" href="{{ link }}" title="{{ name }}" data-gtm="{{ product.getGtmId() }}">{{ name }}</a>
  153.         </td>
  154.             {# Skladova zasoba #}
  155.         <td data-attr-prodStock="{{ translator.getValue('SKLAD') }}" class="stock text-xs-center">
  156.             {% if product.getTypes | length and product.getVariant %}
  157.                 {% include 'component/product/common/availability/avail-types.html.twig' %}
  158.             {% else %}
  159.                 {% include 'component/product/common/availability/avail-basic.html.twig' %}
  160.             {% endif %}
  161.         </td>
  162.         {# Cena s a bez DPH #}
  163.         {#{% if settings.priceIncVat %}
  164.             <td class="price text-xs-right"><span class="price">{{ price.fExcVat | raw }}</span></td>
  165.             <td class="priceVat text-xs-right"><strong class="priceVat">{{ price.fIncVat | raw }}</strong></td>
  166.         {% else %}
  167.             <td class="price text-xs-right"><span class="price">{{ price.fIncVat | raw }}</span></td>
  168.             <td class="priceVat text-xs-right"><strong class="priceVat">{{ price.fExcVat | raw }}</strong></td>
  169.         {% endif %}#}
  170.         {% set unit =  product.getUnit is not null ? product.getUnit.getName : 'Ks'  %}
  171.         {% set priceInfo =  product.package(app.user) > 1 ? translator.getValue('PRICE_FOR_UNIT','cena za 1 %jednotka%') | replace({'%jednotka%' : unit }) : '' %}
  172.     {% if settings.priceIncVat %}
  173.         {% if price.excVat > 0.00 %}
  174.             {# Cena bez DPH #}
  175.             <td data-attr-prodPrice="{{ translator.getValue('CENA_BEZ_DPH') }}" class="price text-xs-right"><span class="price">
  176.                 {% if category.getDecimalPricesStatus() %}
  177.                     {{ currency.formatCustom(price.excVat)|raw }}
  178.                 {% else %}
  179.                     {{ currency.format(price.excVat)|raw }}
  180.                 {% endif %}
  181.             </span></td>
  182.             {# Cena s DPH #}
  183.             <td data-attr-prodPriceVat="{{ translator.getValue('CENA_S_DPH') }}" class="priceVat text-xs-right"><strong class="priceVat">
  184.                 {% if category.getDecimalPricesStatus() %}
  185.                     {{ currency.formatCustom(price.incVat)|raw }}
  186.                 {% else %}
  187.                     {{ currency.format(price.incVat)|raw }}
  188.                 {% endif %}
  189.             </strong></td>
  190.         {% else %}
  191.             {# Cena bez DPH #}
  192.             <td data-attr-prodPrice="{{ translator.getValue('CENA_BEZ_DPH') }}" class="price text-xs-right"><span class="price">{{ translator.getValue('NENI_SKLADEM', 'Na dotaz') }}</span></td>
  193.             {# Cena s DPH #}
  194.             <td data-attr-prodPriceVat="{{ translator.getValue('CENA_S_DPH') }}" class="priceVat text-xs-right"><strong class="priceVat">{{ translator.getValue('NENI_SKLADEM', 'Na dotaz') }}</strong></td>
  195.         {% endif %}
  196.     {% else %}
  197.         {# Cena s DPH #}
  198.         <td data-attr-prodPriceVat="{{ translator.getValue('CENA_S_DPH') }}" class="priceVat text-xs-right"><strong class="priceVat">
  199.             {# Šlo do exceptionu - DM - 2.12.2021 - přidáno is defined pro category #}
  200.             {% if category is defined and category.getDecimalPricesStatus() %}
  201.                 {{ currency.formatCustom(price.excVat)|raw }}
  202.             {% else %}
  203.                 {{ currency.format(price.excVat)|raw }}
  204.             {% endif %}
  205.         </strong></td>
  206.         {# Cena bez DPH #}
  207.         <td data-attr-prodPrice="{{ translator.getValue('CENA_BEZ_DPH') }}" class="price text-xs-right"><span class="price">
  208.             {# Šlo do exceptionu - DM - 2.12.2021 - přidáno is defined pro category #}
  209.             {% if category is defined and category.getDecimalPricesStatus() %}
  210.                 {{ currency.formatCustom(price.incVat)|raw }}
  211.             {% else %}
  212.                 {{ currency.format(price.incVat)|raw }}
  213.             {% endif %}
  214.         </span></td>
  215.     {% endif %}
  216.         {# Porovnat #}
  217.         {% if enableCompare %}
  218.             {% if comparator.hasProduct(id) %}
  219.             <td data-attr-compare="{{ translator.getValue('PRODUCT_COMPARE_TEXT', 'Porovnání produktu') }}" class="comparsion text-xs-center bg-compare">
  220.                 <a class="compare active" data-compare="1" href="/_product-compare/toggle/{{ product.getId() }}" title="{{ translator.getValue('PRODUCT_COMPARE_TEXT', 'Porovnání produktu') }}">
  221.                     <i class="icon-compare"></i>
  222.                 </a>
  223.             </td>
  224.         {% else %}
  225.             <td data-attr-compare="{{ translator.getValue('PRODUCT_COMPARE_TEXT', 'Porovnání produktu') }}" class="comparsion text-xs-center">
  226.                 <a class="compare" data-compare="1" href="/_product-compare/toggle/{{ product.getId() }}" title="{{ translator.getValue('PRODUCT_COMPARE_TEXT', 'Porovnání produktu') }}">
  227.                     <i class="icon-compare"></i>
  228.                 </a>
  229.             </td>
  230.         {% endif %}
  231.     {% endif %}
  232.     {# Detail produktu #}
  233.     {% if partner_config.getAllowListBuy and product.getPrice > 0 %} {# DS 2021-06-28 V078926 nákup z listu jen pokud má produkt cenu #}
  234.         {% if product.getTypes and product.getVariant|length %}
  235.             <td class="productBuy text-xs-center"><a href="{{ link }}" title="{{ name }}" class="btn btn-primary btn-detail pull-md-right" data-gtm="{{ product.getGtmId() }}">{{ translator.getValue('DETAIL') }}</a></td>
  236.         {% else %}
  237.             <td class="productBuy text-xs-center">
  238.             {% include 'component/product/common/purchase_form/list.html.erb' with { product: product } %}
  239.             </td>
  240.         {% endif %}
  241.     {% else %}
  242.         <td class="productBuy text-xs-center"><a href="{{ link }}" title="{{ name }}" class="btn btn-primary btn-detail pull-md-right" data-gtm="{{ product.getGtmId() }}">{{ translator.getValue('DETAIL') }}</a></td>
  243.     {% endif %}
  244. </tr>