templates/eshopProduct_GRID.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="productGRID">
  6.   <div class="productGRIDImage">
  7.    <table border="0" align="center" class="productGRIDTable">
  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="Product Image" border="0" class="productGRIDThumb">
  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.           
  28.       </td>
  29.     </tr>
  30.    </table>
  31.   </div>
  32.   <div class="productGRIDDetail">
  33.      <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ product.productId }}" class="productLinkGRID">{{ product.productName }}</a>
  34.     {% set minValue = 1 %}
  35.       {% if product.isStrictPackSale %}
  36.           {% set strictPackText = 'system.yes'|trans %}
  37.           {% set minValue = product.piecesInPack %}
  38.           {% set minAdd = product.piecesInPack %}
  39.       {% elseif product.minimalAmount is defined %}
  40.           {% set strictPackText = 'system.no'|trans %}
  41.           {% set minValue = product.minimalAmount %}
  42.           {% set minAdd = 1 %}
  43.       {% else %}
  44.           {% set strictPackText = 'system.no'|trans %}
  45.           {% set minAdd = 1 %}
  46.       {% endif %}
  47.       {% if minValue == 0 %}
  48.           {% set minValue = 1 %}
  49.       {% endif %}
  50.       {% if isPackSaleModule is defined and isPackSaleModule %}
  51.           <!-- pack prices -->
  52.           <div class="productListInfoRow">
  53.               <div class="productListInfoCell">{{ 'product.pieces_in_pack'|trans }}:</div>
  54.               <div class="productListInfoValue">{{ product.piecesInPack }}</div>
  55.           </div>
  56.           {% if eshop.isPriceDisplay != false %}
  57.               {% if priceOnRequest is defined and priceOnRequest %}
  58.                   <div class="productListInfoRow">
  59.                       <span class="onRequest">
  60.                       </span>
  61.                   </div>
  62.               {% elseif displayPrice > 0 %}
  63.                   <div class="productListInfoRow">
  64.                       <div class="productListInfoCell">{{ 'product.pack_price'|trans }}:</div>
  65.                       <div class="productListInfoValue">{{ displayPackPrice }} {{ app.session.get('eshopCurrency').currencyKey }}</div>
  66.                   </div>
  67.               {% endif %}
  68.           {% endif %}
  69.       {% endif %}
  70.   </div>  
  71.  
  72.   <div class="productGRIDEdit">
  73.  
  74.     <!-- stock -->
  75.     {% set onRequest = false %}
  76.     {% set priceOnRequest = false %}
  77.     {% if eshop.isStock %}
  78.       {% if product.stock and product.stock > 0 %}
  79.           <div class="stock">
  80.               <div class="onStock">{{ 'eshop.on_stock'|trans }}</div>
  81.               <div class="productStockNumber"> ({{ product.stock }})</div>
  82.           </div>
  83.       {% elseif product.stock and product.stock == -1 %}
  84.           <div class="stock">
  85.               <div class="onStock">{{ 'eshop.on_stock'|trans }}</div>
  86.           </div>
  87.       {% elseif product.stock and product.stock == -2 %}
  88.             {# product stock is on request #}
  89.           <div class="stock">
  90.               <div class="onStock">ON REQUEST</div>
  91.           </div>
  92.       {% elseif product.stock and product.stock == -3 %}
  93.             {# both stock and product info is on request #}
  94.             {% set onRequest = true %}
  95.             {% set priceOnRequest = true %}
  96.           <div class="stock">
  97.               <div class="onRequest">{{ 'eshop.on_request_stock_price'|trans }}</div>
  98.           </div>
  99.       {% else %}
  100.           <div class="stock">
  101.               <div class="notOnStock">{{ 'eshop.not_on_stock'|trans }}</div>
  102.           </div>
  103.       {% endif %}
  104.     {% endif %}
  105.     <!-- price -->
  106.     {% if eshop.isPriceDisplay is defined and eshop.isPriceDisplay is same as(false) %}
  107.     {% else %}
  108.         <div class="productLISTPrice">
  109.             {% if priceOnRequest %}
  110.                 {# we display on request text#}
  111.                 <span class="onRequest">
  112.                 </span>
  113.             {% elseif displayPrice > 0 %}
  114.                 <span class="productPrice1">{{ displayPrice }}</span>
  115.                 <span class="productCurrency1">{{ app.session.get('eshopCurrency').currencyKey }}</span>
  116.             {% endif %}
  117.         </div>
  118.     {% endif %}
  119.     <!-- add to basket -->
  120.     {% if eshop.isPriceDisplay is defined and eshop.isPriceDisplay is same as(false) %}
  121.     {% else %}
  122.         {% if onRequest %}
  123.             <div class="productDetailBasket">
  124.                 <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/request?productId={{ product.productId }}&subject={{ 'eshop.request_product'|trans }}" class="tablinks">{{ 'eshop.request_product'|trans }}</a>
  125.             </div>
  126.         {% elseif eshop.isProductCatalogue is not defined or eshop.isProductCatalogue is not same as(true) %}
  127.           {% if eshop.isAsynchrounousShopping %}
  128.             {# we display asynchronous shopping flow#}
  129.               <div class="productGRIDBasket">
  130.                   <form name="toCartForm" method="POST" action="#product_{{ product.productId }}">
  131.                       <input type="hidden" name="productId" value="{{ product.productId }}">
  132.                       <input type="hidden" name="productPrice" value="{{ displayPrice }}">
  133.                       <input type="hidden" name="orderItemPriceBrutto" value="{{ displayPriceVAT }}">
  134.                       <input type="hidden" name="productPackPrice" value="{{ displayPackPrice }}">
  135.                       <input type="hidden" name="orderItemVAT" value="{{ productVAT }}">
  136.                       <input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
  137.                       <span class="unitUpdate">
  138.                      <input type="text" name="units" id="units_{{ product.productId }}" value="{{ minValue }}" class="basketUnits" size="3">
  139.                    </span>
  140.                    <span class="unitUpdate">
  141.                     <div class="unitUp"><a onclick="javascript:updateUnits('units_{{ product.productId }}', {{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitUpLink">+</a></div>
  142.                     <div class="unitDown"><a onclick="javascript:updateUnits('units_{{ product.productId }}', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
  143.                    </span>
  144.                    <span class="unitUpdate">
  145.                     <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 }}')">
  146.                    </span>
  147.                   </form>
  148.               </div>
  149.           {% else %}
  150.             {# we display classical shopping flow#}
  151.               <div class="productGRIDBasket">
  152.                   <form name="toCartForm" method="POST" action="#product_{{ product.productId }}">
  153.                       <input type="hidden" name="productId" value="{{ product.productId }}">
  154.                       <input type="hidden" name="productPrice" value="{{ displayPrice }}">
  155.                       {% if displayPriceVAT is defined %}
  156.                         <input type="hidden" name="orderItemPriceBrutto" value="{{ displayPriceVAT }}">
  157.                       {% endif %}  
  158.                       {% if displayPackPrice is defined %}
  159.                         <input type="hidden" name="productPackPrice" value="{{ displayPackPrice }}">
  160.                       {% endif %}   
  161.                       {% if productVAT is defined %}
  162.                         <input type="hidden" name="orderItemVAT" value="{{ productVAT }}">
  163.                       {% endif %}    
  164.                       <input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
  165.                       <span class="unitUpdate">
  166.                          <input type="text" name="units" id="units_{{ product.productId }}" value="{{ minValue }}" class="basketUnits" size="3">
  167.                        </span>
  168.                        <span class="unitUpdate">
  169.                         <div class="unitUp"><a onclick="javascript:updateUnits('units_{{ product.productId }}', {{ minAdd }}, {{ minValue }});" href="javascript:void()" class="unitUpLink">+</a></div>
  170.                         <div class="unitDown"><a onclick="javascript:updateUnits('units_{{ product.productId }}', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
  171.                        </span>
  172.                        <span class="unitUpdate">
  173.                         <input type="submit" name="basket" value="{{ 'eshop.to_basket'|trans }}" class="basketButton">
  174.                        </span>
  175.                   </form>
  176.               </div>
  177.           {% endif %}
  178.         {% endif %}
  179.     {% endif %}
  180.     <!-- product detail -->
  181.     <div class="productDetail">
  182.       <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ product.productId }}" class="productDetailLink">{{ 'product.detail'|trans }}</a>
  183.     </div>
  184.     
  185.   </div> 
  186. </div>