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 displayPriceVAT is not defined %}
  128.             {% set displayPriceVAT = null %}
  129.           {% endif %}
  130.           {% if displayPackPrice is not defined %}
  131.             {% set displayPackPrice = null %}
  132.           {% endif %}
  133.           {% if productVAT is not defined %}
  134.             {% set productVAT = null %}
  135.           {% endif %}
  136.           {% if eshop.isAsynchrounousShopping %}
  137.             {# we display asynchronous shopping flow#}
  138.               <div class="productGRIDBasket">
  139.                   <form name="toCartForm" method="POST" action="#product_{{ product.productId }}">
  140.                       <input type="hidden" name="productId" value="{{ product.productId }}">
  141.                       <input type="hidden" name="productPrice" value="{{ displayPrice }}">
  142.                       <input type="hidden" name="orderItemPriceBrutto" value="{{ displayPriceVAT }}">
  143.                       <input type="hidden" name="productPackPrice" value="{{ displayPackPrice }}">
  144.                       <input type="hidden" name="orderItemVAT" value="{{ productVAT }}">
  145.                       <input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
  146.                       <span class="unitUpdate">
  147.                      <input type="text" name="units" id="units_{{ product.productId }}" value="{{ minValue }}" class="basketUnits" size="3">
  148.                    </span>
  149.                    <span class="unitUpdate">
  150.                     <div class="unitUp"><a onclick="javascript:updateUnits('units_{{ product.productId }}', {{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitUpLink">+</a></div>
  151.                     <div class="unitDown"><a onclick="javascript:updateUnits('units_{{ product.productId }}', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
  152.                    </span>
  153.                    <span class="unitUpdate">
  154.                     <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 }}')">
  155.                    </span>
  156.                   </form>
  157.               </div>
  158.           {% else %}
  159.             {# we display classical shopping flow#}
  160.               <div class="productGRIDBasket">
  161.                   <form name="toCartForm" method="POST" action="#product_{{ product.productId }}">
  162.                       <input type="hidden" name="productId" value="{{ product.productId }}">
  163.                       <input type="hidden" name="productPrice" value="{{ displayPrice }}">
  164.                       {% if displayPriceVAT is defined %}
  165.                         <input type="hidden" name="orderItemPriceBrutto" value="{{ displayPriceVAT }}">
  166.                       {% endif %}  
  167.                       {% if displayPackPrice is defined %}
  168.                         <input type="hidden" name="productPackPrice" value="{{ displayPackPrice }}">
  169.                       {% endif %}   
  170.                       {% if productVAT is defined %}
  171.                         <input type="hidden" name="orderItemVAT" value="{{ productVAT }}">
  172.                       {% endif %}    
  173.                       <input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
  174.                       <span class="unitUpdate">
  175.                          <input type="text" name="units" id="units_{{ product.productId }}" value="{{ minValue }}" class="basketUnits" size="3">
  176.                        </span>
  177.                        <span class="unitUpdate">
  178.                         <div class="unitUp"><a onclick="javascript:updateUnits('units_{{ product.productId }}', {{ minAdd }}, {{ minValue }});" href="javascript:void()" class="unitUpLink">+</a></div>
  179.                         <div class="unitDown"><a onclick="javascript:updateUnits('units_{{ product.productId }}', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
  180.                        </span>
  181.                        <span class="unitUpdate">
  182.                         <input type="submit" name="basket" value="{{ 'eshop.to_basket'|trans }}" class="basketButton">
  183.                        </span>
  184.                   </form>
  185.               </div>
  186.           {% endif %}
  187.         {% endif %}
  188.     {% endif %}
  189.     <!-- product detail -->
  190.     <div class="productDetail">
  191.       <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ product.productId }}" class="productDetailLink">{{ 'product.detail'|trans }}</a>
  192.     </div>
  193.     
  194.   </div> 
  195. </div>