templates/eshopProduct_LIST.html.twig line 1

Open in your IDE?
  1. {% if stoneShopPrice is defined and stoneShopPrice > displayPrice %}
  2.     {% set priceDiff = stoneShopPrice - displayPrice %}
  3.     {% set savePercentage = (priceDiff/stoneShopPrice) * 100 %}
  4. {% endif %}
  5. <!-- we display only products with numeric price -->
  6. {% if displayPrice > 0 or eshop.isPriceDisplay == false %}
  7. <div class="productLIST">
  8.   <div class="productLISTImage">
  9.    <table width="{{ eshop.imageThumbWidth }}" border="0">
  10.     <tr>
  11.       <td>
  12.         <!-- we display image thumb -->
  13.         <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ product.productId }}" class="productLink">
  14.             {% if productThumbs[product.productId] is defined %}
  15.                 <img src="{{ asset(productThumbs[product.productId]) }}" alt="" border="0" class="productLISTThumb">
  16.             {% endif %}
  17.         </a>
  18.           {% if stoneShopPrice is defined and stoneShopPrice > displayPrice %}
  19.               <div class="saveAction">
  20.                   <div class="saveFromPrice">
  21.                       {{ stoneShopPrice }}
  22.                       <span class="productDetailCurrency">
  23.                           {{ app.session.get('eshopCurrency').currencyKey }}
  24.                       </span>
  25.                   </div>
  26.                   <div class="savePercentage">-{{ savePercentage|round(0, 'ceil') }}%</div>
  27.               </div>
  28.           {% endif %}
  29.       </td>
  30.     </tr>
  31.    </table>
  32.   </div>
  33.   <div class="productLISTDetail">
  34.     <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ product.productId }}" class="productLISTLink">{{ product.productName }}</a>
  35.     <div class="productLISTDescription">
  36.         {% if eshop.cutLongDescription > 0 and product.productShortDescription != "" and product.productShortDescription|length > eshop.cutLongDescription %}
  37.             {% set productDescription = product.productShortDescription|slice(0, eshop.cutLongDescription) ~ "..." %}
  38.         {% elseif eshop.cutLongDescription > 0 and product.productDescription  != "" and product.productShortDescription|length > eshop.cutLongDescription %}
  39.             {% set productDescription = product.productDescription|slice(0, eshop.cutLongDescription) ~ "..." %}
  40.         {% elseif product.productShortDescription != "" %}
  41.             {% set productDescription = product.productShortDescription %}
  42.         {% else %}
  43.             {% set productDescription = product.productDescription %}
  44.         {% endif %}
  45.         {{ productDescription }}
  46.     </div>
  47.     {% if product.ERPKey is defined %}
  48.         <div class="productListInfoRow">
  49.             <div class="productListInfoCell">{{ 'product.erp_key'|trans }}:</div>
  50.             <div class="productListInfoValue">{{ product.ERPKey }}</div>
  51.         </div>
  52.     {% elseif product.productKey is defined %}
  53.         <div class="productListInfoRow">
  54.             <div class="productListInfoCell">{{ 'product.key'|trans }}:</div>
  55.             <div class="productListInfoValue">{{ product.productKey }}</div>
  56.         </div>
  57.     {% endif %}
  58.     {% set minValue = 1 %}
  59.     {% if product.isStrictPackSale %}
  60.         {% set strictPackText = 'system.yes'|trans %}
  61.         {% set minValue = product.piecesInPack %}
  62.         {% set minAdd = product.piecesInPack %}
  63.     {% elseif product.minimalAmount is defined %}
  64.         {% set strictPackText = 'system.no'|trans %}
  65.         {% set minValue = product.minimalAmount %}
  66.         {% set minAdd = 1 %}
  67.     {% else %}
  68.         {% set strictPackText = 'system.no'|trans %}
  69.         {% set minAdd = 1 %}
  70.     {% endif %}
  71.     {% if minValue == 0 %}
  72.         {% set minValue = 1 %}
  73.     {% endif %}
  74.     {% if isPackSaleModule %}
  75.         <!-- pack prices -->
  76.         {% if product.piecesInPack is defined and product.piecesInPack > 0 %}
  77.             <div class="productListInfoRow">
  78.                 <div class="productListInfoCell">{{ 'product.pieces_in_pack'|trans }}:</div>
  79.                 <div class="productListInfoValue">{{ product.piecesInPack }}</div>
  80.             </div>
  81.         {% endif %}
  82.         {% if eshop.isPriceDisplay != false %}
  83.             {% if priceOnRequest is defined and priceOnRequest %}
  84.                 <div class="productListInfoRow">
  85.                     <span class="onRequest">
  86.                     </span>
  87.                 </div>
  88.             {% elseif displayPrice > 0 and displayPackPrice > 0 %}
  89.                 <div class="productListInfoRow">
  90.                     <div class="productListInfoCell">{{ 'product.pack_price'|trans }}:</div>
  91.                     <div class="productListInfoValue">{{ displayPackPrice }} {{ app.session.get('eshopCurrency').currencyKey }}</div>
  92.                 </div>
  93.             {% endif %}
  94.         {% endif %}
  95.     {% endif %}
  96.   </div>
  97.   
  98.   <div class="productLISTEdit">
  99.     <!-- stock -->
  100.     {% set onRequest = false %}
  101.     {% set priceOnRequest = false %}
  102.     {% if eshop.isStock %}
  103.       {% if product.stock and product.stock > 0 %}
  104.           <div class="stock">
  105.               <div class="onStock">{{ 'eshop.on_stock'|trans }}</div>
  106.               <div class="productStockNumber"> ({{ product.stock }})</div>
  107.           </div>
  108.       {% elseif product.stock and product.stock == -1 %}
  109.           <div class="stock">
  110.               <div class="onStock">{{ 'eshop.on_stock'|trans }}</div>
  111.           </div>
  112.       {% elseif product.stock and product.stock == -2 %}
  113.             {# product stock is on request #}
  114.           <div class="stock">
  115.               <div class="onStock">ON REQUEST</div>
  116.           </div>
  117.       {% elseif product.stock and product.stock == -3 %}
  118.             {# both stock and product info is on request #}
  119.             {% set onRequest = true %}
  120.             {% set priceOnRequest = true %}
  121.           <div class="stock">
  122.               <div class="onRequest">{{ 'eshop.on_request_stock_price'|trans }}</div>
  123.           </div>
  124.       {% else %}
  125.           <div class="stock">
  126.               <div class="notOnStock">{{ 'eshop.not_on_stock'|trans }}</div>
  127.           </div>
  128.       {% endif %}
  129.     {% endif %}
  130.     <!-- price -->
  131.     {% if eshop.isPriceDisplay is defined and eshop.isPriceDisplay is same as(false) %}
  132.     {% else %}
  133.         <div class="productLISTPrice">
  134.             {% if priceOnRequest %}
  135.                 {# we display on request text#}
  136.                 <span class="onRequest">
  137.                 </span>
  138.             {% elseif displayPrice > 0 %}
  139.                 <span class="productPrice1">{{ displayPrice }}</span>
  140.                 <span class="productCurrency1">{{ app.session.get('eshopCurrency').currencyKey }}</span>
  141.             {% endif %}
  142.         </div>
  143.     {% endif %}
  144.     <!-- add to basket -->
  145.     {% if eshop.isPriceDisplay is defined and eshop.isPriceDisplay is same as(false) %}
  146.     {% else %}
  147.         {% if onRequest %}
  148.             <div class="productDetailBasket">
  149.                 <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/request?productId={{ product.productId }}&subject={{ 'eshop.request_product'|trans }}" class="tablinks">{{ 'eshop.request_product'|trans }}</a>
  150.             </div>
  151.         {% elseif eshop.isProductCatalogue is not defined or eshop.isProductCatalogue is not same as(true) %}
  152.           {% if eshop.isAsynchrounousShopping %}
  153.             {# we display asynchronous shopping flow#}
  154.               <div class="productLISTBasket">
  155.                   <form name="toCartForm" method="POST" action="#product_{{ product.productId }}">
  156.                       <input type="hidden" name="productId" value="{{ product.productId }}">
  157.                       <input type="hidden" name="productPrice" value="{{ displayPrice }}">
  158.                       <input type="hidden" name="orderItemPriceBrutto" value="{{ displayPriceVAT }}">
  159.                       <input type="hidden" name="productPackPrice" value="{{ displayPackPrice }}">
  160.                       <input type="hidden" name="orderItemVAT" value="{{ productVAT }}">
  161.                       <input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
  162.                       <span class="unitUpdate">
  163.                      <input type="text" name="units" id="units_{{ product.productId }}" value="{{ minValue }}" class="basketUnits" size="3">
  164.                    </span>
  165.                    <span class="unitUpdate">
  166.                     <div class="unitUp"><a onclick="javascript:updateUnits('units_{{ product.productId }}', {{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitUpLink">+</a></div>
  167.                     <div class="unitDown"><a onclick="javascript:updateUnits('units_{{ product.productId }}', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
  168.                    </span>
  169.                    <span class="unitUpdate">
  170.                     <input type="button" name="basket" value="{{ 'eshop.to_basket'|trans }}" class="basketButton" id="basketButton_{{ product.productId }}" onclick="addBasket('{{ eshop.eshopId }}','{{ product.productId }}',1,{{ displayPrice }},'{{ product.productName }}', '{{ 'eshop.product_inserted'|trans }}', 'units_{{ product.productId }}')">
  171.                    </span>
  172.                   </form>
  173.               </div>
  174.           {% else %}
  175.             {# we display classical shopping flow#}
  176.               <div class="productLISTBasket">
  177.                   <form name="toCartForm" method="POST" action="#product_{{ product.productId }}">
  178.                       <input type="hidden" name="productId" value="{{ product.productId }}">
  179.                       <input type="hidden" name="productPrice" value="{{ displayPrice }}">
  180.                       <input type="hidden" name="orderItemPriceBrutto" value="{{ displayPriceVAT }}">
  181.                       <input type="hidden" name="productPackPrice" value="{{ displayPackPrice }}">
  182.                       <input type="hidden" name="orderItemVAT" value="{{ productVAT }}">
  183.                       <input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
  184.                       <span class="unitUpdate">
  185.                          <input type="text" name="units" id="units_{{ product.productId }}" value="{{ minValue }}" class="basketUnits" size="3">
  186.                        </span>
  187.                        <span class="unitUpdate">
  188.                         <div class="unitUp"><a onclick="javascript:updateUnits('units_{{ product.productId }}', {{ minAdd }}, {{ minValue }});" href="javascript:void()" class="unitUpLink">+</a></div>
  189.                         <div class="unitDown"><a onclick="javascript:updateUnits('units_{{ product.productId }}', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
  190.                        </span>
  191.                        <span class="unitUpdate">
  192.                         <input type="submit" name="basket" value="{{ 'eshop.to_basket'|trans }}" class="basketButton" id="basketButton_{{ product.productId }}">
  193.                        </span>
  194.                   </form>
  195.               </div>
  196.           {% endif %}
  197.         {% endif %}
  198.     {% endif %}
  199.     <!-- product detail -->
  200.     <div class="productDetail">
  201.       <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ product.productId }}" class="productDetailLink">{{ 'product.detail'|trans }}</a>
  202.     </div>
  203.     <!-- product variants -->
  204.     {% if productVariants[product.productId] is defined and productVariants[product.productId]|length > 0 %}
  205.       <span class="productDetail">
  206.          <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ product.productId }}#variants" class="productDetailVariants">{{ 'module.productVariant'|trans }}</a>
  207.        </span>
  208.     {% endif %}
  209.   </div>
  210. </div>
  211. {% endif %}