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