{% if stoneShopPrice is defined and stoneShopPrice > displayPrice %}
{% set priceDiff = stoneShopPrice - displayPrice %}
{% set savePercentage = (priceDiff/stoneShopPrice) * 100 %}
{% endif %}
<div class="productGRID">
<div class="productGRIDImage">
<table border="0" align="center" class="productGRIDTable">
<tr>
<td>
<!-- we display image thumb -->
<a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ product.productId }}" class="productLink">
{% if productThumbs[product.productId] is defined %}
<img src="{{ asset(productThumbs[product.productId]) }}" alt="Product Image" border="0" class="productGRIDThumb">
{% endif %}
</a>
{% if stoneShopPrice is defined and stoneShopPrice > displayPrice %}
<div class="saveAction">
<div class="saveFromPrice">
{{ stoneShopPrice }}
<span class="productDetailCurrency">
{{ app.session.get('eshopCurrency').currencyKey }}
</span>
</div>
<div class="savePercentage">-{{ savePercentage|round(0, 'ceil') }}%</div>
</div>
{% endif %}
</td>
</tr>
</table>
</div>
<div class="productGRIDDetail">
<a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ product.productId }}" class="productLinkGRID">{{ product.productName }}</a>
{% set minValue = 1 %}
{% if product.isStrictPackSale %}
{% set strictPackText = 'system.yes'|trans %}
{% set minValue = product.piecesInPack %}
{% set minAdd = product.piecesInPack %}
{% elseif product.minimalAmount is defined %}
{% set strictPackText = 'system.no'|trans %}
{% set minValue = product.minimalAmount %}
{% set minAdd = 1 %}
{% else %}
{% set strictPackText = 'system.no'|trans %}
{% set minAdd = 1 %}
{% endif %}
{% if minValue == 0 %}
{% set minValue = 1 %}
{% endif %}
{% if isPackSaleModule is defined and isPackSaleModule %}
<!-- pack prices -->
<div class="productListInfoRow">
<div class="productListInfoCell">{{ 'product.pieces_in_pack'|trans }}:</div>
<div class="productListInfoValue">{{ product.piecesInPack }}</div>
</div>
{% if eshop.isPriceDisplay != false %}
{% if priceOnRequest is defined and priceOnRequest %}
<div class="productListInfoRow">
<span class="onRequest">
</span>
</div>
{% elseif displayPrice > 0 %}
<div class="productListInfoRow">
<div class="productListInfoCell">{{ 'product.pack_price'|trans }}:</div>
<div class="productListInfoValue">{{ displayPackPrice }} {{ app.session.get('eshopCurrency').currencyKey }}</div>
</div>
{% endif %}
{% endif %}
{% endif %}
</div>
<div class="productGRIDEdit">
<!-- stock -->
{% set onRequest = false %}
{% set priceOnRequest = false %}
{% if eshop.isStock %}
{% if product.stock and product.stock > 0 %}
<div class="stock">
<div class="onStock">{{ 'eshop.on_stock'|trans }}</div>
<div class="productStockNumber"> ({{ product.stock }})</div>
</div>
{% elseif product.stock and product.stock == -1 %}
<div class="stock">
<div class="onStock">{{ 'eshop.on_stock'|trans }}</div>
</div>
{% elseif product.stock and product.stock == -2 %}
{# product stock is on request #}
<div class="stock">
<div class="onStock">ON REQUEST</div>
</div>
{% elseif product.stock and product.stock == -3 %}
{# both stock and product info is on request #}
{% set onRequest = true %}
{% set priceOnRequest = true %}
<div class="stock">
<div class="onRequest">{{ 'eshop.on_request_stock_price'|trans }}</div>
</div>
{% else %}
<div class="stock">
<div class="notOnStock">{{ 'eshop.not_on_stock'|trans }}</div>
</div>
{% endif %}
{% endif %}
<!-- price -->
{% if eshop.isPriceDisplay is defined and eshop.isPriceDisplay is same as(false) %}
{% else %}
<div class="productLISTPrice">
{% if priceOnRequest %}
{# we display on request text#}
<span class="onRequest">
</span>
{% elseif displayPrice > 0 %}
<span class="productPrice1">{{ displayPrice }}</span>
<span class="productCurrency1">{{ app.session.get('eshopCurrency').currencyKey }}</span>
{% endif %}
</div>
{% endif %}
<!-- add to basket -->
{% if eshop.isPriceDisplay is defined and eshop.isPriceDisplay is same as(false) %}
{% else %}
{% if onRequest %}
<div class="productDetailBasket">
<a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/request?productId={{ product.productId }}&subject={{ 'eshop.request_product'|trans }}" class="tablinks">{{ 'eshop.request_product'|trans }}</a>
</div>
{% elseif eshop.isProductCatalogue is not defined or eshop.isProductCatalogue is not same as(true) %}
{% if eshop.isAsynchrounousShopping %}
{# we display asynchronous shopping flow#}
<div class="productGRIDBasket">
<form name="toCartForm" method="POST" action="#product_{{ product.productId }}">
<input type="hidden" name="productId" value="{{ product.productId }}">
<input type="hidden" name="productPrice" value="{{ displayPrice }}">
<input type="hidden" name="orderItemPriceBrutto" value="{{ displayPriceVAT }}">
<input type="hidden" name="productPackPrice" value="{{ displayPackPrice }}">
<input type="hidden" name="orderItemVAT" value="{{ productVAT }}">
<input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
<span class="unitUpdate">
<input type="text" name="units" id="units_{{ product.productId }}" value="{{ minValue }}" class="basketUnits" size="3">
</span>
<span class="unitUpdate">
<div class="unitUp"><a onclick="javascript:updateUnits('units_{{ product.productId }}', {{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitUpLink">+</a></div>
<div class="unitDown"><a onclick="javascript:updateUnits('units_{{ product.productId }}', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
</span>
<span class="unitUpdate">
<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 }}')">
</span>
</form>
</div>
{% else %}
{# we display classical shopping flow#}
<div class="productGRIDBasket">
<form name="toCartForm" method="POST" action="#product_{{ product.productId }}">
<input type="hidden" name="productId" value="{{ product.productId }}">
<input type="hidden" name="productPrice" value="{{ displayPrice }}">
{% if displayPriceVAT is defined %}
<input type="hidden" name="orderItemPriceBrutto" value="{{ displayPriceVAT }}">
{% endif %}
{% if displayPackPrice is defined %}
<input type="hidden" name="productPackPrice" value="{{ displayPackPrice }}">
{% endif %}
{% if productVAT is defined %}
<input type="hidden" name="orderItemVAT" value="{{ productVAT }}">
{% endif %}
<input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
<span class="unitUpdate">
<input type="text" name="units" id="units_{{ product.productId }}" value="{{ minValue }}" class="basketUnits" size="3">
</span>
<span class="unitUpdate">
<div class="unitUp"><a onclick="javascript:updateUnits('units_{{ product.productId }}', {{ minAdd }}, {{ minValue }});" href="javascript:void()" class="unitUpLink">+</a></div>
<div class="unitDown"><a onclick="javascript:updateUnits('units_{{ product.productId }}', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
</span>
<span class="unitUpdate">
<input type="submit" name="basket" value="{{ 'eshop.to_basket'|trans }}" class="basketButton">
</span>
</form>
</div>
{% endif %}
{% endif %}
{% endif %}
<!-- product detail -->
<div class="productDetail">
<a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ product.productId }}" class="productDetailLink">{{ 'product.detail'|trans }}</a>
</div>
</div>
</div>