{% if wireFrame.wireFrameFile is defined and wireFrame.wireFrameFile != null %}
{% set wireFrameFile = wireFrame.wireFrameFile %}
{% else %}
{% set wireFrameFile = 'eshopLayoutBasic.html.twig' %}
{% endif %}
{% extends wireFrameFile %}
{% block page_contents %}
{# we get price(s) to display#}
{% set displayPrice = null %}
{% set stoneShopPrice = null %}
{% for price in productPriceList %}
{% if price.productId == product.productId %}
{# we get price level according to logged contact-customer#}
{% if app.session.get('contact') is defined and app.session.get('contact').priceLevel is defined and price.priceLevelId == app.session.get('contact').priceLevel.priceLevelId %}
{# we get netto or brutto value according to e-shop configuration #}
{% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
{% set displayPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
{% else %}
{% set displayPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
{% endif %}
{% elseif price.priceLevelId == 1 or displayPrice == 0 or displayPrice == "" or displayPrice is not defined %}
{% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
{% set displayPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
{% else %}
{% set displayPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
{% endif %}
{% elseif price.priceLevelId > 1 %}
{% for priceLevel in priceLevelList %}
{% if price.priceLevelId == priceLevel.priceLevelId and priceLevel.priceLevelName == "stoneshop" %}
{% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
{% set stoneShopPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
{% else %}
{% set stoneShopPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% set displayPackPrice = null %}
{% if isPackSaleModule %}
{# we get pack price(s) to display#}
{% for price in productPackPriceList %}
{% if price.productId == product.productId %}
{% if app.session.get('contact') is defined and app.session.get('contact').priceLevel is defined and price.priceLevelId == app.session.get('contact').priceLevel.priceLevelId %}
{# we get netto or brutto value according to e-shop configuration #}
{% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
{% set displayPackPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
{% else %}
{% set displayPackPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
{% endif %}
{% elseif price.priceLevelId == 1 or displayPrice == 0 or displayPrice == "" or displayPrice is not defined %}
{# we get default price level#}
{% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
{% set displayPackPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
{% else %}
{% set displayPackPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% if stoneShopPrice is defined and stoneShopPrice > displayPrice %}
{% set priceDiff = stoneShopPrice - displayPrice %}
{% set savePercentage = (priceDiff/stoneShopPrice) * 100 %}
{% endif %}
<!-- category path -->
<div class="productPath">
{% set catCount = 0 %}
{% if categoryPath is defined %}
{% for cat in categoryPath %}
{% if catCount == 0 %}
<a href="{{ path('root') }}eshop/{{ eshop.eshopId }}" class="pathLinkHome">{{ 'eshop.home'|trans }}</a>
{% endif %}
<span class="pathSeparator">|</span> <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/category/{{ cat.categoryId }}" class="pathLink">{{ cat.categoryName }}</a>
{% set catCount = catCount + 1 %}
{% endfor %}
{% endif %}
</div>
<div class="productInfo">
<div class="productImage">
{% if product.image1 is defined and product.image1 != "" %}
{% if 'http' in product.image1 %}
{% set imagePath = product.image1 %}
{% else %}
{% set imagePath = 'users/' ~ user.userName ~ '/images/' ~ product.image1 %}
{% endif %}
<img src="{{ asset(imagePath) }}" alt="{{ product.productName }}" title="{{ 'image.view_original'|trans }}" border="0" id="image_view_full" class="productDetailImage">
{% endif %}
{% 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 %}
</div>
{% if product.productModelLink is defined and product.productModelLink != '' %}
<div id="x3d_product" class="x3d_product">
<div class="x3d_model">
<x3d width="270px" height="500px" id="x3d_section" style="width: 270px; height: 500px; border-bottom: 1px solid #777;background-color: #FFF;">
<scene id="x3d_scene">
<NavigationInfo headlight="true" visibilityLimit="0.0" type='"FLY", "ANY"' avatarSize="0.25, 2.4, 0.75" speed='2.0'></NavigationInfo>
<viewpoint orientation='0 1 0 -0' position='0 3 12' id='x3d_viewpoint_1'></viewpoint>
<viewpoint orientation='0 1 0 1' position='-10 3 0' id='x3d_viewpoint_2'></viewpoint>
<viewpoint orientation='0 1 0 0.5' position='-10 3 -13' id='x3d_viewpoint_3'></viewpoint>
<viewpoint orientation='0 1 0 -0' position='0 3 11' id='x3d_viewpoint_home'></viewpoint>
<viewpoint orientation='0 1 0 0.65' position='0 1 8.5' id='x3d_viewpoint_menu'></viewpoint>
<DirectionalLight ambientIntensity='0.835991' direction='0.584419 0.286636 0.75914'></DirectionalLight>
<!-- FreeWorld X3D -->
<Transform DEF = 'ProductX3D'
id = 'ProductX3D'
translation = '0 0 0'
scale = '1 1 1'
rotation='0 1 0 0'>
<Inline nameSpaceName="ProductX3D_model" mapDEFToID="true" url="{{ product.productModelLink }}"></Inline>
</Transform>
</scene>
</x3d>
</div>
<div class="x3d_model_menu">
<a href="javascript:void(0);" class="x3d_model_reload">Home</a>
<a href="javascript:void(0);" class="x3d_model_link" onclick="zoomProduct(0.5)">Zoom In</a>
<a href="javascript:void(0);" class="x3d_model_link" onclick="zoomProduct(-0.5)">Zoom Out</a>
<a href="javascript:void(0);" class="x3d_model_link" onclick="rotateProductHorisontal(0.5)">Left</a>
<a href="javascript:void(0);" class="x3d_model_link" onclick="rotateProductHorisontal(-0.5)">Right</a>
</div>
</div>
{% endif %}
<div class="productBasicInfo">
<h1 class="productTitle">{{ product.productName }}</h1>
<!-- 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 %}
{% if product.ERPKey is defined %}
<div class="productErpKey">
<div class="productBasicInfoCell">{{ 'product.erp_key'|trans }}:</div>
<div class="productBasicInfoValue">{{ product.ERPKey }}</div>
</div>
{% endif %}
{% if product.productKey is defined %}
<div class="productBasicInfoRow">
<div class="productBasicInfoCell">{{ 'product.key'|trans }}:</div>
<div class="productBasicInfoValue">{{ product.productKey }}</div>
</div>
{% endif %}
<div class="productBasicInfoRow">
<div class="productShortDescription">{{ product.productShortDescription|raw }}</div>
</div>
<div class="productBasicInfoRow">
<div class="productFilterParams">
{% set allParamValsList = [] %}
{% if productVariantList is defined %}
{% set counter = 0 %}
{% for productVariant in productVariantList %}
{% set productVariantId = productVariant.productId %}
{% for parameter in productVariantParameters %}
{% set variantParamVals = productVariantParameterValues[productVariantId] %}
{% for paramVal in variantParamVals %}
{% if productParameterId is defined and parameter.productParameterId == paramVal.productParameterId and paramVal.productParameterValue is defined %}
{% set productParameterVal = allParamValsList[productParameterId] %}
{% set temp = allParamValsList[productParameterId]|merge([paramVal.productParameterValue]) %}
{% set allParamValsList = allParamValsList|merge(temp) %}
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
{% set paramValsList = [] %}
{# {% for parameter in productParameterList %}#}
{# {% if parameter is defined and parameter.isFilterable %}#}
{# {% set paramVal = '' %}#}
{# {% for parameterValue in productParameterValueList %}#}
{# {% if parameterValue.productParameterValue is defined and parameterValue.productParameterId == parameter.productParameterId %}#}
{# {% set paramId = parameter.productParameterId %}#}
{# {% if parameter.parameterType == 2 and parameterValue.productParameterValue == 1 %}#}
{# {% set paramVal = 'system.yes'|trans %}#}
{# {% else %}#}
{# {% if parameterValue.productParameterValue is defined and parameterValue.productParameterValue != '' %}#}
{# {% set paramVal = parameterValue.productParameterValue %}#}
{# {% endif %}#}
{# #}{# {% set temp = paramValsList[paramId]|merge([parameterValue.productParameterValue]) %}#}
{# #}{# {% set paramValsList = paramValsList[paramId]|merge(temp) %} #}
{# {% endif %}#}
{# {% elseif parameter.parameterType == 2 and parameterValue.productParameterId == parameter.productParameterId %}#}
{# {% set paramVal = '<span class="parameterNo"></span>' %}#}
{# {% endif %}#}
{# {% endfor %}#}
{# {% endif %}#}
{# <br> --- paramVal Final: {{ paramVal }}#}
{# {% if paramVal is defined and paramVal != '' %}#}
{# <div class="parameterFilterRow">#}
{# <div class="parameterFilterLabel">{{ 'system.select'|trans }} {{ parameter.productParameterName }}</div>#}
{# <div class="parameterFilter">#}
{# <select name="filterParameter_{{ parameter.productParameterId }}" class="parameterFilterSelector">#}
{# <option value="0">{{ 'system.select'|trans }}</option>#}
{# {% set usedParamIds = [] %}#}
{# {% for paramId, paramVals in allParamValsList %}#}
{# {% if parameter.productParameterId == paramId %}#}
{# #}{# {% set query = array_unset(query, 'array_key') %}#}
{# #}{# $paramVals = array_unique($paramVals);#}
{# {% if paramId not in usedParamIds %}#}
{# {% for val in paramVals %}#}
{# {% if val == paramVal %}#}
{# {% set selected = 'selected' %}#}
{# {% else %}#}
{# {% set selected = '' %}#}
{# {% endif %}#}
{# <option value="{{ parameter.productParameterId }}" {{ selected }}>{{ val }}</option>#}
{# {% endfor %}#}
{# {% set usedParamIds = usedParamIds|merge([paramId]) %}#}
{# {% endif %}#}
{# {% endif %}#}
{# {% endfor %}#}
{# </select>#}
{# </div>#}
{# </div>#}
{# <?php#}
{# }#}
{# }}#}
{# {% endif %}#}
{# {% endfor %} #}
{% endif %}
{% set allParamValsList = [] %}
{% if productVariantList is defined %}
{% set allParamValsList = [] %}
{% endif %}
</div>
</div>
{% if eshop.isPriceDisplay != false %}
<div class="productBasicInfoRow">
<div class="productBasicInfoCell">{{ 'eshop.price'|trans }}:</div>
<div class="productDetailPrice">
{% if priceOnRequest %}
<span class="onPriceRequest">
{{ 'system.on_request'|trans }}
</span>
{% elseif displayPrice > 0 %}
{{ displayPrice }}
<span class="productDetailCurrency">
{{ app.session.get('eshopCurrency').currencyKey }}
</span>
{% endif %}
</div>
</div>
{% if stoneShopPrice is defined and stoneShopPrice > displayPrice %}
<div class="productBasicInfoRow">
<div class="productBasicInfoCell">{{ 'eshop.price_stoneshop'|trans }}:</div>
<div class="productDetailPriceStoneShop">
<!-- StoneShop price -->
{{ stoneShopPrice }}
<span class="productDetailCurrency">
{{ app.session.get('eshopCurrency').currencyKey }}
</span>
</div>
</div>
{% endif %}
<div class="productBasicInfoRow">
{% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
{% set displayPriceVAT = displayPrice + (displayPrice * (productVAT/100)) %}
{% set displayPriceVATLabel = 'product.price_with_VAT'|trans %}
{% else %}
{% set displayPriceVAT = displayPrice - (displayPrice * (productVAT/100)) %}
{% set displayPriceVATLabel = 'product.price_without_VAT'|trans %}
{% endif %}
<div class="productBasicInfoCell">{{ displayPriceVATLabel }} [{{ productVAT }}%]:</div>
<div class="productDetailPriceVAT">
{% if priceOnRequest %}
<span class="onPriceRequest">
{{ 'system.on_request'|trans }}
</span>
{% else %}
{{ displayPriceVAT }}
<span class="productDetailCurrency">
{{ app.session.get('eshopCurrency').currencyKey }}
</span>
{% endif %}
</div>
</div>
{% endif %}
{% set minValue = 1 %}
{% set minAdd = 1 %}
{% if isPackSaleModule %}
<div class="productBasicInfoRow">
<div class="productBasicInfoCell">{{ 'product.pieces_in_pack'|trans }}:</div>
<div class="productBasicInfoValue">{{ product.piecesInPack }}</div>
</div>
<!-- pack price -->
{% if eshop.isPriceDisplay != false %}
{% 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 priceOnRequest %}
<div class="productBasicInfoRow">
<span class="onRequest">
</span>
</div>
{% elseif displayPrice > 0 %}
<div class="productBasicInfoRow">
<div class="productBasicInfoCell">{{ 'product.pieces_in_pack'|trans }}:</div>
<div class="productBasicInfoValue">{{ displayPackPrice }} {{ app.session.get('eshopCurrency').currencyKey }}</div>
</div>
<div class="productBasicInfoRow">
<div class="productBasicInfoCell">{{ 'product.strict_pack_sale'|trans }}:</div>
<div class="productBasicInfoValue">{{ strictPackText }}</div>
</div>
{% endif %}
{% endif %}
{% endif %}
{% if eshop.isPriceDisplay != false %}
{% if onRequest %}
{# we display request button #}
<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 != true %}
{% if eshop.isAsynchrounousShopping %}
{# we display asynchronous shopping flow #}
<div class="productDetailBasket">
<form name="toCartForm" method="POST">
<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" value="{{ minValue }}" class="basketUnits" size="3"></span>
<span class="unitUpdate">
<div class="unitUp"><a onclick="javascript:updateUnits('units', {{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitUpLink">+</a></div>
<div class="unitDown"><a onclick="javascript:updateUnits('units', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
</span>
<span class="unitUpdate"><input type="button" name="basket" class="basketButton" value="{{ 'eshop.to_basket'|trans }}" onclick="addBasket('{{ eshop.eshopId }}','{{ product.productId }}',1,{{ displayPrice }},'{{ product.productName }}', '{{ 'eshop.product_inserted'|trans }}', 'units')"></span>
{# we display link to variants #}
{% if productVariantList is defined and productVariantList|length > 0 %}
<span class="productDetail">
<a href="#variants" class="productDetailVariants">{{ 'module.productVariant'|trans }}</a>
</span>
{% endif %}
</form>
</div>
{% else %}
<div class="productDetailBasket">
<form name="toCartForm" method="POST">
<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 }}<?= $productVAT ?>">
<input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
<span class="unitUpdate"><input type="text" name="units" id="units" value="{{ minValue }}" class="basketUnits" size="3"></span>
<span class="unitUpdate">
<div class="unitUp"><a onclick="javascript:updateUnits('units', {{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitUpLink">+</a></div>
<div class="unitDown"><a onclick="javascript:updateUnits('units', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
</span>
<span class="unitUpdate"><input type="submit" name="basket" class="basketButton" value="{{ 'eshop.to_basket'|trans }}"></span>
{% if productVariantList is defined and productVariantList|length > 0 %}
<span class="productDetail">
<a href="#variants" class="productDetailVariants">{{ 'module.productVariant'|trans }}</a>
</span>
{% endif %}
</form>
</div>
{% endif %}
{% endif %}
{% endif %}
</div>
</div>
<!-- view associated gallery thumbnails -->
{% if product.imageGallery is defined %}
<div class="imageGalleryBox">
{% for imageGallery in product.imageGallery %}
{% set galleryId = imageGallery.galleryId %}
{% if imageGallery.thumbSize is defined and imageGallery.thumbSize > 0 %}
{% set thumbSize = imageGallery.thumbSize %}
{% else %}
{% set thumbSize = 200 %}
{% endif %}
{% for galleryItem in galleryItemCollection[galleryId] %}
{% set imagePath = (userDirs['images'] ~ '/' ~ galleryItem.galleryItemFile)|replace({'../web/': ''}) %}
{% set imageThumbPath = (userDirs['images'] ~ '/' ~ galleryItem.galleryItemFile)|replace({'../web/': ''}) %}
{% set imageWebPath = (userDirs['web'] ~ '/images/' ~ galleryItem.galleryItemFile)|replace({'../web/': ''}) %}
{% set thumbWidth = 500 %}
{% set defaultThumbWidth = 500 %}
{% set defaultThumbHeight = 150 %}
{% set webPath = userDirs['web'] ~ "/images/" ~ galleryItem.galleryItemFile %}
<div class="galleryItemBox">
<img src="{{ imageWebPath }}" alt="Gallery Item" class="galleryItemImage" border="0" width="{{ thumbSize }}">
</div>
{% endfor %}
{% endfor %}
</div>
{% endif %}
{% if product.productDescription is defined %}
<div class="productDescription">
{{ product.productDescription|raw }}
</div>
{% endif %}
{% if productParameterList is defined and productParameterGroupList|length == 0 %}
<div class="parameters">
<h3>{{ 'module.productParameter'|trans }}</h3>
<table cellpadding="0" cellspacing="0">
{% for parameter in productParameterList %}
{% set paramVal = '' %}
{% set stringValue = '' %}
{% if parameter is defined %}
{% set count = 0 %}
{% for parameterValue in productParameterValueList %}
{% if parameterValue.productParameterValue is defined and parameterValue.productParameterId == parameter.productParameterId %}
{% if productVariantParameterValues[product.productId] is defined and productVariantParameterValues[product.productId][count].productParameterValue %}
{% set stringValue = productVariantParameterValues[product.productId][count].productParameterValue %}
{% else %}
{% if parameterValue.productParameterValue is defined and parameterValue.productParameterValue != '' %}
{% set stringValue = parameterValue.productParameterValue %}
{% endif %}
{# {% set stringValue = 'some value' %}#}
{% endif %}
{# if we have value then we put it to $paramVal#}
{% if parameter.parameterType == 2 and parameterValue.parameterValue == 1 %}
{# true/false is set to 1#}
{% set paramVal = "<span class='parameterYes'>{{ 'system.yes'|trans }}</span>" %}
{% else %}
{% set paramVal = '<span>' ~ stringValue ~ '</span>' %}
{% endif %}
{% endif %}
{% set count = count + 1 %}
{% endfor %}
<tr class="parameterRow">
<td class="parameterName">{{ parameter.productParameterName }}</td>
<td class="parameterValue">{{ paramVal|raw }}</td>
</tr>
{% endif %}
{% endfor %}
</table>
</div>
<br>
{% endif %}
{#we display parameter groups - then we display parameters#}
{% if productParameterGroupList is defined %}
{% for parameterGroup in productParameterGroupList %}
<button class="tablinks" onclick="location.href='#paramGroup_{{ parameterGroup.productParameterGroupId }}'">{{ parameterGroup.productParameterGroupName }}</button>
{% endfor %}
{% for parameterGroup in productParameterGroupList %}
<div class="parameterGroupTab">
<a name="paramGroup_<?= $parameterGroup->getProductParameterGroupId() ?>"></a>
<h3>{{ parameterGroup.productParameterGroupName }}</h3>
<table cellpadding="0" cellspacing="0" class="parameterTable">
{% for parameter in productParameterList %}
{% set isParamInGroup = false %}
{% for paramGroup in parameter.parameterGroups %}
{% if paramGroup == parameterGroup %}
{% set isParamInGroup = true %}
{% endif %}
{% endfor %}
{% if paramGroup is defined %}
{% set paramVal = '' %}
{% for parameterValue in productParameterValueList %}
{% if parameterValue.productParameterValue is defined and parameterValue.productParameterId == parameter.productParameterId %}
{# if we have value then we put it to $paramVal#}
{% if parameter.parameterType == 2 and parameterValue.productParameterValue == 1 %}
{% set paramVal = '<span class="parameterYes">{{ "system.yes"|trans }}</span>' %}
{% else %}
{% set paramVal = parameterValue.productParameterValue %}
{% endif %}
{% elseif parameter.parameterType == 2 and parameterValue.productParameterId == parameter.productParameterId %}
{# type true/false is set to null#}
{% endif %}
{% endfor %}
{% if paramVal is defined %}
<tr class="parameterRow">
<td class="parameterName">{{ parameter.productParameterName }}</td>
<td class="parameterValue">{{ paramVal }}</td>
</tr>
{% endif %}
{% endif %}
{% endfor %}
</table>
</div>
{% endfor %}
{% endif %}
{% if productParameterGroupList is defined %}
{% for parameterGroup in productParameterGroupList %}
<br>
{% endfor %}
<button class="tablinks" onclick="location.href='#top'">{{ 'system.top'|trans }}</button>
<br><br><br>
{% endif %}
{% if productVariantList is defined and productVariantList|length > 0 %}
<a name="variants"></a>
<div class="variants">
<h3>{{ 'module.productVariant'|trans }}</h3>
<table cellpadding="0" cellspacing="0" border="0" class="variantTable">
{% set counter = 0 %}
{% for productVariant in productVariantList %}
{% set productVariantId = productVariant.productId %}
{% if counter == 0 %}
<tr class="variantRowHeading">
<th class="variantHeading">{{ 'module.productVariant_name'|trans }}</th>
<th class="variantHeading">id</th>
<th class="variantHeading">{{ 'product.key'|trans }}</th>
<th class="variantHeading">{{ 'product.erp_key'|trans }}</th>
<th class="variantHeading">{{ 'eshop.price'|trans }}</th>
{% if eshop.displayNettoPrices and eshop.displayNettoPrices == true %}
{% set displayPriceVATLabel = 'product.price_with_VAT'|trans %}
{% else %}
{% set displayPriceVATLabel = 'product.price_without_VAT'|trans %}
{% endif %}
<th class="variantHeading">{{ displayPriceVATLabel }} [{{ productVAT }}%]</th>
<th class="variantHeading"></th>
<th class="variantHeading"></th>
{% for parameter in productVariantParameters %}
<th class="variantHeading">{{ parameter.productParameterName }}</th>
{% endfor %}
</tr>
{% endif %}
{# {% if counter == 0 %}#}
<tr class="variantRow">
<td class="variantName"><a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ productVariant.productId }}" class="variantLISTLink">{{ variantTexts[productVariantId] }}</a></td>
<td class="variantValue">{{ productVariant.productId }}</td>
<td class="variantValue">{{ productVariant.productKey }}</td>
<td class="variantValue">{{ productVariant.ERPKey }}</td>
<td class="variantPrice">
{% if eshop.isPriceDisplay != false %}
<div>
{% set displayPrice = null %}
{% for price in productPriceList %}
{% if price.productId == productVariant.productId %}
{# we get price level according to logged contact-customer#}
{% if app.session.get('contact') is defined and app.session.get('contact').priceLevel is defined and price.priceLevelId == app.session.get('contact').priceLevel.priceLevelId %}
{% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
{% set displayPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
{% else %}
{% set displayPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
{% endif %}
{% elseif price.priceLevelId == 1 or displayPrice is not defined or displayPrice == 0 or displayPrice == "" %}
{% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
{% set displayPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
{% else %}
{% set displayPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% if priceOnRequest %}
<span class="onPriceRequest">
{{ 'system.on_request'|trans }}
</span>
{% elseif displayPrice > 0 %}
{{ displayPrice }}
<span class="productDetailCurrency">
{{ app.session.get('eshopCurrency').currencyKey }}
</span>
{% endif %}
{% endif %}
</div>
</td>
<td class="variantValue">
{% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
{% set displayPriceVAT = (displayPrice + (displayPrice * (productVAT/100))) %}
{% set displayPriceVATLabel = 'product.price_with_VAT'|trans %}
{% else %}
{% set displayPriceVAT = (displayPrice - (displayPrice * (productVAT/100))) %}
{% set displayPriceVATLabel = 'product.price_without_VAT'|trans %}
{% endif %}
<div>
{% if priceOnRequest %}
<span class="onPriceRequest">
{{ 'system.on_request'|trans }}
</span>
{% else %}
{{ displayPriceVAT }}
<span class="productDetailCurrency">
{{ app.session.get('eshopCurrency').currencyKey }}
</span>
{% endif %}
</div>
</td>
<td class="addCartPane">
{% if eshop.isAsynchrounousShopping %}
<div class="productLISTBasket">
<form name="toCartForm" method="POST" action="#product_{{ productVariant.productId }}">
<input type="hidden" name="productId" value="{{ productVariant.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_{{ productVariant.productId }}" value="{{ minValue }}" class="basketUnits" size="3">
</span>
<span class="unitUpdate">
<div class="unitUp"><a onclick="javascript:updateUnits('units_{{ productVariant.productId }}', {{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitUpLink">+</a></div>
<div class="unitDown"><a onclick="javascript:updateUnits('units_{{ productVariant.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 }}','{{ productVariant.productId }}',1,{{ displayPrice }},'{{ productVariant.productName }}', '{{ 'eshop.product_inserted'|trans }}', 'units_{{ productVariant.productId }}')">
</span>
</form>
</div>
{% else %}
{# we display classical shopping flow #}
<div class="productLISTBasket">
<form name="toCartForm" method="POST" action="#product_{{ productVariant.productId }}">
<input type="hidden" name="productId" value="{{ productVariant.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_{{ productVariant.productId }}" value="{{ minValue }}" class="basketUnits" size="3">
</span>
<span class="unitUpdate">
<div class="unitUp"><a onclick="javascript:updateUnits('units_{{ productVariant.productId }}', {{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitUpLink">+</a></div>
<div class="unitDown"><a onclick="javascript:updateUnits('units_{{ productVariant.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 %}
</td>
<td class="variantValue"><a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ productVariant.productId }}" class="productDetailLink">{{ 'product.detail'|trans }}</a></td>
{% for parameter in productVariantParameters %}
{% set variantParamVals = productVariantParameterValues[productVariantId] %}
{% for paramVal in variantParamVals %}
{% if parameter.productParameterId == paramVal.productParameterId and paramVal.productParameterValue is defined %}
<td class="variantValue">{{ paramVal.productParameterValue }} </td>
{% endif %}
{% endfor %}
{% endfor %}
</tr>
{% set counter = counter + 1 %}
{% endfor %}
</table>
</div>
{% endif %}
<!-- 3D gallery -->
{% if product.gallery3dId is defined and product.gallery3dId > 0 %}
<div class="productBasicInfoRow">{{ gallery3d|raw }}</div>
{% endif %}
{% endblock %}