templates/eshopProduct.html.twig line 1

Open in your IDE?
  1. {% if wireFrame.wireFrameFile is defined and wireFrame.wireFrameFile != null %}
  2.     {% set wireFrameFile = wireFrame.wireFrameFile  %}
  3. {% else %}
  4.     {% set wireFrameFile = 'eshopLayoutBasic.html.twig' %}
  5. {% endif %}
  6. {% extends wireFrameFile %}
  7. {% block page_contents %}
  8.     {# we get price(s) to display#}
  9.     {% set displayPrice = null %}
  10.     {% set stoneShopPrice = null %}
  11.     {% for price in productPriceList %}
  12.         {% if price.productId == product.productId %}
  13.             {# we get price level according to logged contact-customer #}
  14.   
  15.             {# <br>dump: {{ dump(app.session.get('contact')) }} #}
  16.             {% if app.session.get('contact') is defined 
  17.                 and app.session.get('contact').priceLevel is defined 
  18.                 and app.session.get('contact').priceLevel 
  19.                 and price.priceLevelId == app.session.get('contact').priceLevel.priceLevelId %} 
  20.             {# {% if app.session.get('contact') is defined %} #}
  21.                 {# we get netto or brutto value according to e-shop configuration #}
  22.                 {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  23.                     {% set displayPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
  24.                 {% else %}
  25.                     {% set displayPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
  26.                 {% endif %}
  27.             {% elseif price.priceLevelId == 1 or displayPrice == 0 or displayPrice == "" or displayPrice is not defined %}
  28.                 {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  29.                     {% set displayPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
  30.                 {% else %}
  31.                     {% set displayPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
  32.                 {% endif %}
  33.             {% elseif price.priceLevelId > 1 %}
  34.                 {% for priceLevel in priceLevelList %}
  35.                     {% if price.priceLevelId == priceLevel.priceLevelId and priceLevel.priceLevelName == "stoneshop" %}
  36.                         {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  37.                             {% set stoneShopPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
  38.                         {% else %}
  39.                             {% set stoneShopPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
  40.                         {% endif %}
  41.                     {% endif %}
  42.                 {% endfor %}
  43.             {% endif %}
  44.         {% endif %}
  45.     {% endfor %}
  46.     {% set displayPackPrice = null %}
  47.     {% if isPackSaleModule %}
  48.         {# we get pack price(s) to display#}
  49.         {% for price in productPackPriceList %}
  50.             {% if price.productId == product.productId %}
  51.                 {% if app.session.get('contact') is defined 
  52.                     and app.session.get('contact').priceLevel is defined 
  53.                     and app.session.get('contact').priceLevel
  54.                     and price.priceLevelId == app.session.get('contact').priceLevel.priceLevelId %}
  55.                     {# we get netto or brutto value according to e-shop configuration #}
  56.                     {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  57.                         {% set displayPackPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
  58.                     {% else %}
  59.                         {% set displayPackPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
  60.                     {% endif %}
  61.                 {% elseif price.priceLevelId == 1 or displayPrice == 0 or displayPrice == "" or displayPrice is not defined %}
  62.                     {# we get default price level#}
  63.                     {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  64.                         {% set displayPackPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
  65.                     {% else %}
  66.                         {% set displayPackPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
  67.                     {% endif %}
  68.                 {% endif %}
  69.             {% endif %}
  70.         {% endfor %}
  71.     {% endif %}
  72.     {% if stoneShopPrice is defined and stoneShopPrice > displayPrice %}
  73.         {% set priceDiff = stoneShopPrice - displayPrice %}
  74.         {% set savePercentage = (priceDiff/stoneShopPrice) * 100 %}
  75.     {% endif %}
  76. <!-- category path -->
  77. <div class="productPath">
  78.     {% set catCount = 0 %}
  79.     {% if categoryPath is defined %}
  80.         {% for cat in categoryPath %}
  81.             {% if catCount == 0 %}
  82.                 <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}" class="pathLinkHome">{{ 'eshop.home'|trans }}</a>
  83.             {% endif %}
  84.             <span class="pathSeparator">|</span> <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/category/{{ cat.categoryId }}" class="pathLink">{{ cat.categoryName }}</a>
  85.             {% set catCount = catCount + 1 %}
  86.         {% endfor %}
  87.     {% endif %}
  88. </div>
  89. <div class="productInfo">
  90.     <div class="productImage">
  91.         {% if product.image1 is defined and product.image1 != "" %}
  92.             {% if 'http' in product.image1 %}
  93.                 {% set imagePath = product.image1 %}
  94.             {% else %}
  95.                 {% set imagePath = 'users/' ~ user.userName ~ '/images/' ~ product.image1 %}
  96.             {% endif %}
  97.             <img src="{{ asset(imagePath) }}" alt="{{ product.productName }}" title="{{ 'image.view_original'|trans }}" border="0" id="image_view_full" class="productDetailImage">
  98.         {% endif %}
  99.         {% if stoneShopPrice is defined and stoneShopPrice > displayPrice %}
  100.             <div class="saveAction">
  101.                 <div class="saveFromPrice">
  102.                     {{ stoneShopPrice }}
  103.                     <span class="productDetailCurrency">
  104.                   {{ app.session.get('eshopCurrency').currencyKey }}
  105.                 </span>
  106.                 </div>
  107.                 <div class="savePercentage">-{{ savePercentage|round(0, 'ceil') }}%</div>
  108.             </div>
  109.         {% endif %}
  110.     </div>
  111.     {% if product.productModelLink is defined and product.productModelLink != '' %}
  112.         <div id="x3d_product" class="x3d_product">
  113.             <div class="x3d_model">
  114.                 <x3d width="270px" height="500px" id="x3d_section" style="width: 270px; height: 500px; border-bottom: 1px solid #777;background-color: #FFF;">
  115.                     <scene id="x3d_scene">
  116.                         <NavigationInfo headlight="true" visibilityLimit="0.0" type='"FLY", "ANY"' avatarSize="0.25, 2.4, 0.75" speed='2.0'></NavigationInfo>
  117.                         <viewpoint orientation='0 1 0 -0' position='0 3 12'  id='x3d_viewpoint_1'></viewpoint>
  118.                         <viewpoint orientation='0 1 0 1' position='-10 3 0'  id='x3d_viewpoint_2'></viewpoint>
  119.                         <viewpoint orientation='0 1 0 0.5' position='-10 3 -13'  id='x3d_viewpoint_3'></viewpoint>
  120.                         <viewpoint orientation='0 1 0 -0' position='0 3 11'  id='x3d_viewpoint_home'></viewpoint>
  121.                         <viewpoint orientation='0 1 0 0.65' position='0 1 8.5'  id='x3d_viewpoint_menu'></viewpoint>
  122.                         <DirectionalLight ambientIntensity='0.835991' direction='0.584419 0.286636 0.75914'></DirectionalLight>
  123.                         <!-- FreeWorld X3D -->
  124.                         <Transform DEF = 'ProductX3D'
  125.                                    id = 'ProductX3D'
  126.                                    translation = '0 0 0'
  127.                                    scale = '1 1 1'
  128.                                    rotation='0 1 0 0'>
  129.                             <Inline nameSpaceName="ProductX3D_model" mapDEFToID="true" url="{{ product.productModelLink }}"></Inline>
  130.                         </Transform>
  131.                     </scene>
  132.                 </x3d>
  133.             </div>
  134.             <div class="x3d_model_menu">
  135.                 <a href="javascript:void(0);" class="x3d_model_reload">Home</a>
  136.                 <a href="javascript:void(0);" class="x3d_model_link" onclick="zoomProduct(0.5)">Zoom In</a>
  137.                 <a href="javascript:void(0);" class="x3d_model_link" onclick="zoomProduct(-0.5)">Zoom Out</a>
  138.                 <a href="javascript:void(0);" class="x3d_model_link" onclick="rotateProductHorisontal(0.5)">Left</a>
  139.                 <a href="javascript:void(0);" class="x3d_model_link" onclick="rotateProductHorisontal(-0.5)">Right</a>
  140.             </div>
  141.         </div>
  142.     {% endif %}
  143.     <div class="productBasicInfo">
  144.         <h1 class="productTitle">{{ product.productName }}</h1>
  145.         <!-- stock -->
  146.         {% set onRequest = false %}
  147.         {% set priceOnRequest = false %}
  148.         {% if eshop.isStock %}
  149.             {% if product.stock and product.stock > 0 %}
  150.                 <div class="stock">
  151.                     <div class="onStock">{{ 'eshop.on_stock'|trans }}</div>
  152.                     <div class="productStockNumber"> ({{ product.stock }})</div>
  153.                 </div>
  154.             {% elseif product.stock and product.stock == -1 %}
  155.                 <div class="stock">
  156.                     <div class="onStock">{{ 'eshop.on_stock'|trans }}</div>
  157.                 </div>
  158.             {% elseif product.stock and product.stock == -2 %}
  159.                 {# product stock is on request #}
  160.                 <div class="stock">
  161.                     <div class="onStock">ON REQUEST</div>
  162.                 </div>
  163.             {% elseif product.stock and product.stock == -3 %}
  164.                 {# both stock and product info is on request #}
  165.                 {% set onRequest = true %}
  166.                 {% set priceOnRequest = true %}
  167.                 <div class="stock">
  168.                     <div class="onRequest">{{ 'eshop.on_request_stock_price'|trans }}</div>
  169.                 </div>
  170.             {% else %}
  171.                 <div class="stock">
  172.                     <div class="notOnStock">{{ 'eshop.not_on_stock'|trans }}</div>
  173.                 </div>
  174.             {% endif %}
  175.         {% endif %}
  176.         <div class="productBasicInfoRow">
  177.             <div class="productShortDescription">{{ product.productShortDescription|raw }}</div>
  178.         </div>
  179.         {% if product.ERPKey is defined and product.ERPKey != '' %}
  180.             <div class="productErpKey">
  181.                 <div class="productBasicInfoCell">{{ 'product.erp_key'|trans }}:</div>
  182.                 <div class="productBasicInfoValue">{{ product.ERPKey }}</div>
  183.             </div>
  184.         {% endif %}
  185.         {% if product.productKey is defined and product.productKey != '' %}
  186.             <div class="productBasicInfoRow"> 
  187.                 <div class="productBasicInfoCell">{{ 'product.key'|trans }}:</div>
  188.                 <div class="productBasicInfoValue">{{ product.productKey }}</div>
  189.             </div>
  190.         {% endif %}
  191.         <div class="productBasicInfoRow">
  192.             <div class="productFilterParams">
  193.                 {% set allParamValsList = [] %}
  194.                 {% if productVariantList is defined %}
  195.                 {% set counter = 0 %}
  196.                 {% for productVariant in productVariantList %}
  197.                     {% set productVariantId = productVariant.productId %}
  198.                     {% for parameter in productVariantParameters %}
  199.                         {% set variantParamVals = productVariantParameterValues[productVariantId] %}
  200.                         {% for paramVal in variantParamVals %}
  201.                             {% if productParameterId is defined and parameter.productParameterId == paramVal.productParameterId and paramVal.productParameterValue is defined %}
  202.                                 {% set productParameterVal = allParamValsList[productParameterId] %}
  203.                                 {% set temp = allParamValsList[productParameterId]|merge([paramVal.productParameterValue]) %}
  204.                                 {% set allParamValsList = allParamValsList|merge(temp) %}
  205.                             {% endif %}
  206.                         {% endfor %}
  207.                     {% endfor %}
  208.                 {% endfor %}
  209.                 {% set paramValsList = [] %}
  210. {#              {% for parameter in productParameterList %}#}
  211. {#              {% if parameter is defined and parameter.isFilterable %}#}
  212. {#                  {% set paramVal = '' %}#}
  213. {#                  {% for parameterValue in productParameterValueList %}#}
  214. {#                      {% if parameterValue.productParameterValue is defined and parameterValue.productParameterId == parameter.productParameterId %}#}
  215. {#                          {% set paramId = parameter.productParameterId %}#}
  216. {#                          {% if parameter.parameterType == 2 and parameterValue.productParameterValue == 1 %}#}
  217. {#                              {% set paramVal = 'system.yes'|trans %}#}
  218. {#                          {% else %}#}
  219. {#                              {% if parameterValue.productParameterValue is defined and parameterValue.productParameterValue != '' %}#}
  220. {#                                  {% set paramVal = parameterValue.productParameterValue %}#}
  221. {#                              {% endif %}#}
  222. {#                              #}{# {% set temp = paramValsList[paramId]|merge([parameterValue.productParameterValue]) %}#}
  223. {#                              #}{# {% set paramValsList = paramValsList[paramId]|merge(temp) %} #}
  224. {#                          {% endif %}#}
  225. {#                      {% elseif parameter.parameterType == 2 and parameterValue.productParameterId == parameter.productParameterId %}#}
  226. {#                          {% set paramVal = '<span class="parameterNo"></span>' %}#}
  227. {#                      {% endif %}#}
  228. {#                  {% endfor %}#}
  229. {#              {% endif %}#}
  230. {#              <br> --- paramVal Final: {{ paramVal }}#}
  231. {#              {% if paramVal is defined and paramVal != '' %}#}
  232. {#              <div class="parameterFilterRow">#}
  233. {#                  <div class="parameterFilterLabel">{{ 'system.select'|trans }} {{ parameter.productParameterName }}</div>#}
  234. {#                  <div class="parameterFilter">#}
  235. {#                      <select name="filterParameter_{{ parameter.productParameterId }}" class="parameterFilterSelector">#}
  236. {#                          <option value="0">{{ 'system.select'|trans }}</option>#}
  237. {#                          {% set usedParamIds = [] %}#}
  238. {#                          {% for paramId, paramVals in allParamValsList %}#}
  239. {#                              {% if parameter.productParameterId == paramId %}#}
  240. {#                                  #}{#                                    {% set query = array_unset(query, 'array_key') %}#}
  241. {#                                  #}{#                                    $paramVals = array_unique($paramVals);#}
  242. {#                                  {% if paramId not in usedParamIds %}#}
  243. {#                                      {% for val in paramVals %}#}
  244. {#                                          {% if val == paramVal %}#}
  245. {#                                              {% set selected = 'selected' %}#}
  246. {#                                          {% else %}#}
  247. {#                                              {% set selected = '' %}#}
  248. {#                                          {% endif %}#}
  249. {#                                          <option value="{{ parameter.productParameterId }}" {{ selected }}>{{ val }}</option>#}
  250. {#                                      {% endfor %}#}
  251. {#                                      {% set usedParamIds = usedParamIds|merge([paramId]) %}#}
  252. {#                                  {% endif %}#}
  253. {#                              {% endif %}#}
  254. {#                          {% endfor %}#}
  255. {#                      </select>#}
  256. {#                  </div>#}
  257. {#              </div>#}
  258. {#              <?php#}
  259. {#                      }#}
  260. {#                }}#}
  261. {#              {% endif %}#}
  262. {#          {% endfor %} #}
  263.       {% endif %}
  264.       {% set allParamValsList = [] %}
  265.       {% if productVariantList is defined %}
  266.         {% set allParamValsList = [] %}
  267.       {% endif  %}
  268.     </div>
  269.             </div>
  270.             {% if eshop.isPriceDisplay != false %}
  271.                 <div class="productBasicInfoRow">
  272.                     <div class="productBasicInfoCell">{{ 'eshop.price'|trans }}:</div>
  273.                     <div class="productDetailPrice">
  274.                         {% if priceOnRequest %}
  275.                             <span class="onPriceRequest">
  276.                         {{ 'system.on_request'|trans }}
  277.                   </span>
  278.                         {% elseif displayPrice > 0 %}
  279.                             {{ displayPrice }}
  280.                             <span class="productDetailCurrency">
  281.                      {{ app.session.get('eshopCurrency').currencyKey }}
  282.                    </span>
  283.                         {% endif %}
  284.                     </div>
  285.                 </div>
  286.                 {% if stoneShopPrice is defined and stoneShopPrice > displayPrice %}
  287.                     <div class="productBasicInfoRow">
  288.                         <div class="productBasicInfoCell">{{ 'eshop.price_stoneshop'|trans }}:</div>
  289.                         <div class="productDetailPriceStoneShop">
  290.                             <!-- StoneShop price -->
  291.                             {{ stoneShopPrice }}
  292.                             <span class="productDetailCurrency">
  293.                    {{ app.session.get('eshopCurrency').currencyKey }}
  294.                   </span>
  295.                         </div>
  296.                     </div>
  297.                 {% endif  %}
  298.                 <div class="productBasicInfoRow">
  299.                     {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  300.                         {% set displayPriceVAT = displayPrice + (displayPrice * (productVAT/100)) %}
  301.                         {% set displayPriceVATLabel = 'product.price_with_VAT'|trans %}
  302.                     {% else %}
  303.                         {% set displayPriceVAT = displayPrice - (displayPrice * (productVAT/100)) %}
  304.                         {% set displayPriceVATLabel = 'product.price_without_VAT'|trans %}
  305.                     {% endif %}
  306.                     <div class="productBasicInfoCell">{{ displayPriceVATLabel }} [{{ productVAT }}%]:</div>
  307.                     <div class="productDetailPriceVAT">
  308.                         {% if priceOnRequest %}
  309.                             <span class="onPriceRequest">
  310.                         {{ 'system.on_request'|trans }}
  311.                   </span>
  312.                         {% else %}
  313.                             {{ displayPriceVAT }}
  314.                             <span class="productDetailCurrency">
  315.                      {{ app.session.get('eshopCurrency').currencyKey }}
  316.                    </span>
  317.                         {% endif %}
  318.                     </div>
  319.                 </div>
  320.             {% endif %}
  321.             {% set minValue = 1 %}
  322.             {% set minAdd = 1 %}
  323.             {% if isPackSaleModule %}
  324.                 {% if product.piecesInPack is defined and product.piecesInPack != '' %}  
  325.                 <div class="productBasicInfoRow">
  326.                     <div class="productBasicInfoCell">{{ 'product.pieces_in_pack'|trans }}:</div>
  327.                     <div class="productBasicInfoValue">{{ product.piecesInPack }}</div>
  328.                 </div>
  329.                 {% endif %}
  330.                 <!-- pack price -->
  331.                 {% if eshop.isPriceDisplay != false %}
  332.                     {% if product.isStrictPackSale %}
  333.                         {% set strictPackText = 'system.yes'|trans %}
  334.                         {% set minValue = product.piecesInPack %}
  335.                         {% set minAdd = product.piecesInPack %}
  336.                     {% elseif product.minimalAmount is defined %}
  337.                         {% set strictPackText = 'system.no'|trans %}
  338.                         {% set minValue = product.minimalAmount %}
  339.                         {% set minAdd = 1 %}
  340.                     {% else %}
  341.                         {% set strictPackText = 'system.no'|trans %}
  342.                         {% set minAdd = 1 %}
  343.                     {% endif %}
  344.                     {% if priceOnRequest %}
  345.                 <div class="productBasicInfoRow">
  346.                     <span class="onRequest">
  347.                     </span>
  348.                 </div>
  349.                     {% elseif displayPrice > 0 and displayPackPrice > 0 %}  
  350.                         <div class="productBasicInfoRow">
  351.                             <div class="productBasicInfoCell">{{ 'product.pieces_in_pack'|trans }}:</div>
  352.                             <div class="productBasicInfoValue">{{ displayPackPrice }} {{ app.session.get('eshopCurrency').currencyKey }}</div>
  353.                         </div>
  354.                         <div class="productBasicInfoRow">
  355.                             <div class="productBasicInfoCell">{{ 'product.strict_pack_sale'|trans }}:</div>
  356.                             <div class="productBasicInfoValue">{{ strictPackText }}</div>
  357.                         </div>
  358.                     {% endif %}
  359.                 {% endif %}
  360.             {% endif %}
  361.             {% if eshop.isPriceDisplay != false %}
  362.                 {% if onRequest %}
  363.                     {# we display request button #}
  364.                     <div class="productDetailBasket">
  365.                         <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/request?productId={{ product.productId }}&subject={{ 'eshop.request_product'|trans }}" class="tablinks">{{ 'eshop.request_product'|trans }}</a>
  366.                     </div>
  367.                 {% elseif eshop.isProductCatalogue != true %}
  368.                     {% if eshop.isAsynchrounousShopping %}
  369.                         {# we display asynchronous shopping flow #}
  370.                         <div class="productDetailBasket">
  371.                             <form name="toCartForm" method="POST">
  372.                                 <input type="hidden" name="productId" value="{{ product.productId }}">
  373.                                 <input type="hidden" name="productPrice" value="{{ displayPrice }}">
  374.                                 <input type="hidden" name="orderItemPriceBrutto" value="{{ displayPriceVAT }}">
  375.                                 <input type="hidden" name="productPackPrice" value="{{ displayPackPrice }}">
  376.                                 <input type="hidden" name="orderItemVAT" value="{{ productVAT }}">
  377.                                 <input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
  378.                                 <span class="unitUpdate"><input type="text" name="units" id="units" value="{{ minValue }}" class="basketUnits" size="3"></span>
  379.                                 <span class="unitUpdate">
  380.                   <div class="unitUp"><a onclick="javascript:updateUnits('units', {{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitUpLink">+</a></div>
  381.                   <div class="unitDown"><a onclick="javascript:updateUnits('units', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
  382.                  </span>
  383.                                 <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>
  384.                                 {# we display link to variants  #}
  385.                                 {% if productVariantList is defined and productVariantList|length > 0 %}
  386.                                     <span class="productDetail">
  387.                              <a href="#variants" class="productDetailVariants">{{ 'module.productVariant'|trans }}</a>
  388.                            </span>
  389.                                 {% endif %}
  390.                             </form>
  391.                         </div>
  392.                     {% else %}
  393.                         <div class="productDetailBasket">
  394.                             <form name="toCartForm" method="POST">
  395.                                 <input type="hidden" name="productId" value="{{ product.productId }}">
  396.                                 <input type="hidden" name="productPrice" value="{{ displayPrice }}">
  397.                                 <input type="hidden" name="orderItemPriceBrutto" value="{{ displayPriceVAT }}">
  398.                                 <input type="hidden" name="productPackPrice" value="{{ displayPackPrice }}">
  399.                                 <input type="hidden" name="orderItemVAT" value="{{ productVAT }}<?= $productVAT ?>">
  400.                                 <input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
  401.                                 <span class="unitUpdate"><input type="text" name="units" id="units" value="{{ minValue }}" class="basketUnits" size="3"></span>
  402.                                 <span class="unitUpdate">
  403.                   <div class="unitUp"><a onclick="javascript:updateUnits('units', {{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitUpLink">+</a></div>
  404.                   <div class="unitDown"><a onclick="javascript:updateUnits('units', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
  405.                  </span>
  406.                                 <span class="unitUpdate"><input type="submit" name="basket" class="basketButton" value="{{ 'eshop.to_basket'|trans }}"></span>
  407.                                 {% if productVariantList is defined and productVariantList|length > 0 %}
  408.                                     <span class="productDetail">
  409.                            <a href="#variants" class="productDetailVariants">{{ 'module.productVariant'|trans }}</a>
  410.                          </span>
  411.                                 {% endif %}
  412.                             </form>
  413.                         </div>
  414.                     {% endif %}
  415.                 {% endif %}
  416.             {% endif %}
  417.         </div>
  418.     </div>
  419.     <!-- view associated gallery thumbnails -->
  420.     {% if product.imageGallery is defined %}
  421.         <div class="imageGalleryBox">
  422.             {% for imageGallery in product.imageGallery %}
  423.                 {% set galleryId = imageGallery.galleryId %}
  424.                 {% if imageGallery.thumbSize is defined and imageGallery.thumbSize > 0 %}
  425.                     {% set thumbSize = imageGallery.thumbSize %}
  426.                 {% else %}
  427.                     {% set thumbSize = 200 %}
  428.                 {% endif %}
  429.                 {% for galleryItem in galleryItemCollection[galleryId] %}
  430.                     {% set imagePath = (userDirs['images'] ~ '/' ~ galleryItem.galleryItemFile)|replace({'../web/': ''})  %}
  431.                     {% set imageThumbPath = (userDirs['images'] ~ '/' ~ galleryItem.galleryItemFile)|replace({'../web/': ''})  %}
  432.                     {% set imageWebPath = (userDirs['web'] ~ '/images/' ~ galleryItem.galleryItemFile)|replace({'../web/': ''})  %}
  433.                     {% set thumbWidth = 500 %}
  434.                     {% set defaultThumbWidth = 500 %}
  435.                     {% set defaultThumbHeight = 150 %}
  436.                     {% set webPath = userDirs['web'] ~ "/images/" ~ galleryItem.galleryItemFile %}
  437.                     <div class="galleryItemBox">
  438.                         <img src="{{ imageWebPath }}" alt="Gallery Item" class="galleryItemImage" border="0" width="{{ thumbSize }}">
  439.                     </div>
  440.                 {% endfor %}
  441.             {% endfor %}
  442.         </div>
  443.     {% endif %}
  444.     {% if product.productDescription is defined %}
  445.         <div class="productDescription">
  446.             {{ product.productDescription|raw }}
  447.         </div>
  448.     {% endif %}
  449.     {% if productParameterList is defined and productParameterList|length > 0 and productParameterGroupList|length == 0 %}
  450.         <div class="parameters">
  451.             <h3>{{ 'module.productParameter'|trans }}</h3>
  452.             <table cellpadding="0" cellspacing="0">
  453.                 {% for parameter in productParameterList %}
  454.                     {% set paramVal = '' %}
  455.                     {% set stringValue = '' %}
  456.                     {% if parameter is defined %}
  457.                         {% set count = 0 %}
  458.                         {% for parameterValue in productParameterValueList %}
  459.                             {% if parameterValue.productParameterValue is defined and parameterValue.productParameterId == parameter.productParameterId %}
  460.                                 {% if productVariantParameterValues[product.productId] is defined 
  461.                                 and productVariantParameterValues[product.productId][count].productParameterValue is defined 
  462.                                 and productVariantParameterValues[product.productId][count].productParameterValue %}
  463.                                     {% set stringValue = productVariantParameterValues[product.productId][count].productParameterValue %}
  464.                                 {% else %}
  465.                                     {% if parameterValue.productParameterValue is defined and parameterValue.productParameterValue != '' %}
  466.                                         {% set stringValue = parameterValue.productParameterValue %}
  467.                                     {% endif %}
  468.                                     {#  {% set stringValue = 'some value' %}#}
  469.                                 {% endif %}
  470.                                 {#                    if we have value then we put it to $paramVal#}
  471.                                 {% if parameter.parameterType == 2 and parameterValue.parameterValue == 1 %}
  472.                                     {#                        true/false is set to 1#}
  473.                                     {% set paramVal = "<span class='parameterYes'>{{ 'system.yes'|trans }}</span>" %}
  474.                                 {% else %}
  475.                                     {% set paramVal = '<span>' ~ stringValue ~ '</span>' %}
  476.                                 {% endif %}
  477.                             {% endif %}
  478.                             {% set count = count + 1 %}
  479.                         {% endfor %}
  480.                         <tr class="parameterRow">
  481.                             <td class="parameterName">{{ parameter.productParameterName }}</td>
  482.                             <td class="parameterValue">{{ paramVal|raw }}</td>
  483.                         </tr>
  484.                     {% endif %}
  485.                 {% endfor %}
  486.             </table>
  487.         </div>
  488.         <br>
  489.     {% endif %}
  490.     {#we display parameter groups - then we display parameters#}
  491.     {% if productParameterGroupList is defined %}
  492.         {% for parameterGroup in productParameterGroupList %}
  493.             <button class="tablinks" onclick="location.href='#paramGroup_{{ parameterGroup.productParameterGroupId }}'">{{ parameterGroup.productParameterGroupName }}</button>
  494.         {% endfor %}
  495.         {% for parameterGroup in productParameterGroupList %}
  496.             <div class="parameterGroupTab">
  497.                 <a name="paramGroup_<?= $parameterGroup->getProductParameterGroupId() ?>"></a>
  498.                 <h3>{{ parameterGroup.productParameterGroupName }}</h3>
  499.                 <table cellpadding="0" cellspacing="0" class="parameterTable">
  500.                     {% for parameter in productParameterList %}
  501.                         {% set isParamInGroup = false %}
  502.                         {% for paramGroup in parameter.parameterGroups %}
  503.                             {% if paramGroup == parameterGroup %}
  504.                                 {% set isParamInGroup = true %}
  505.                             {% endif %}
  506.                         {% endfor %}
  507.                         {% if paramGroup is defined %}
  508.                             {% set paramVal = '' %}
  509.                             {% for parameterValue in productParameterValueList %}
  510.                                 {% if parameterValue.productParameterValue is defined and parameterValue.productParameterId == parameter.productParameterId %}
  511.                                     {#                                if we have value then we put it to $paramVal#}
  512.                                     {% if parameter.parameterType == 2 and parameterValue.productParameterValue == 1 %}
  513.                                         {% set paramVal = '<span class="parameterYes">{{ "system.yes"|trans }}</span>' %}
  514.                                     {% else %}
  515.                                         {% set paramVal = parameterValue.productParameterValue %}
  516.                                     {% endif %}
  517.                                 {% elseif parameter.parameterType == 2 and parameterValue.productParameterId == parameter.productParameterId %}
  518.                                     {#                                type true/false is set to null#}
  519.                                 {% endif %}
  520.                             {% endfor %}
  521.                             {% if paramVal is defined %}
  522.                                 <tr class="parameterRow">
  523.                                     <td class="parameterName">{{ parameter.productParameterName }}</td>
  524.                                     <td class="parameterValue">{{ paramVal }}</td>
  525.                                 </tr>
  526.                             {% endif %}
  527.                         {% endif %}
  528.                     {% endfor %}
  529.                 </table>
  530.             </div>
  531.         {% endfor %}
  532.     {% endif %}
  533.     {% if productParameterGroupList is defined %}
  534.         {% for parameterGroup in productParameterGroupList %}
  535.             <br>
  536.         {% endfor %}
  537.         <button class="productDetailVariants" onclick="location.href='#top'">{{ 'system.top'|trans }}</button>
  538.         <br><br><br>
  539.     {% endif %}
  540.     {% if productVariantList is defined and productVariantList|length > 0 %}
  541.         <a name="variants"></a>
  542.         <div class="variants">
  543.             <h3>{{ 'module.productVariant'|trans }}</h3>
  544.             <table cellpadding="0" cellspacing="0" border="0" class="variantTable">
  545.                 {% set counter = 0 %}
  546.                 {% for productVariant in productVariantList %}
  547.                     {% set productVariantId = productVariant.productId %}
  548.                     {% if counter == 0 %}
  549.                         <tr class="variantRowHeading">
  550.                             <th class="variantHeading"></th>
  551.                             <th class="variantHeading">{{ 'module.productVariant_name'|trans }}</th>
  552.                             <th class="variantHeading">id</th>
  553.                             <th class="variantHeading">{{ 'product.key'|trans }}</th>
  554.                             <th class="variantHeading">{{ 'product.erp_key'|trans }}</th>
  555.                             <th class="variantHeading">{{ 'eshop.price'|trans }}</th>
  556.                             {% if eshop.displayNettoPrices and eshop.displayNettoPrices == true %}
  557.                                 {% set displayPriceVATLabel = 'product.price_with_VAT'|trans %}
  558.                             {% else %}
  559.                                 {% set displayPriceVATLabel = 'product.price_without_VAT'|trans %}
  560.                             {% endif %}
  561.                             <th class="variantHeading">{{ displayPriceVATLabel }} [{{ productVAT }}%]</th>
  562.                             <th class="variantHeading"></th>
  563.                             <th class="variantHeading"></th>
  564.                             {% for parameter in productVariantParameters %}
  565.                                 <th class="variantHeading">{{ parameter.productParameterName }}</th>
  566.                             {% endfor %}
  567.                         </tr>
  568.                     {% endif %}
  569.                     {#                {% if counter == 0 %}#}
  570.                     <tr class="variantRow">
  571.                          <td class="basketItemImage" align="center">
  572.                              {% if productVariant.image1 is defined %}
  573.                                 {% if 'http' in productVariant.image1 %}
  574.                                     {% set imagePath = productVariant.image1 %}
  575.                                 {% else %}
  576.                                     {% set imagePath = 'users/' ~ user.userName ~ '/images/' ~ productVariant.image1 %}
  577.                                 {% endif %}
  578.                                 <img src="{{ asset(imagePath) }}" alt="{{ productVariant.productName }}" title="{{ 'image.view_original'|trans }}" border="0" height="35" id="image_view_full">
  579.                              {% endif %}
  580.                          </td> 
  581.                         <td class="variantName"><a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ productVariant.productId }}" class="variantLISTLink">{{ variantTexts[productVariantId] }}</a></td>
  582.                         <td class="variantValue">{{ productVariant.productId }}</td>
  583.                         <td class="variantValue">{{ productVariant.productKey }}</td>
  584.                         <td class="variantValue">{{ productVariant.ERPKey }}</td>
  585.                         <td class="variantPrice">
  586.                             {% if eshop.isPriceDisplay != false %}
  587.                             <div>
  588.                                 {% set displayPrice = null %}
  589.                                 {% for price in productPriceList %}
  590.                                     {% if price.productId == productVariant.productId %}
  591.                                         {# we get price level according to logged contact-customer #}
  592.                                         {% if app.session.get('contact') is defined 
  593.                                             and app.session.get('contact').priceLevel is defined 
  594.                                             and app.session.get('contact').priceLevel 
  595.                                             and price.priceLevelId == app.session.get('contact').priceLevel.priceLevelId %}
  596.                                             {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  597.                                                 {% set displayPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
  598.                                             {% else %}
  599.                                                 {% set displayPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
  600.                                             {% endif %}
  601.                                         {% elseif price.priceLevelId == 1 or displayPrice is not defined or displayPrice == 0 or displayPrice == "" %}
  602.                                             {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  603.                                                 {% set displayPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
  604.                                             {% else %}
  605.                                                 {% set displayPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
  606.                                             {% endif %}
  607.                                         {% endif %}
  608.                                     {% endif %}
  609.                                 {% endfor %}
  610.                                 {% if priceOnRequest %}
  611.                                     <span class="onPriceRequest">
  612.                                 {{ 'system.on_request'|trans }}
  613.                             </span>
  614.                                 {% elseif displayPrice > 0 %}
  615.                                     {{ displayPrice }}
  616.                                     <span class="productDetailCurrency">
  617.                                 {{ app.session.get('eshopCurrency').currencyKey }}
  618.                            </span>
  619.                                 {% endif %}
  620.                                 {% endif %}
  621.                             </div>
  622.                         </td>
  623.                         <td class="variantValue">
  624.                             {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  625.                                 {% set displayPriceVAT = (displayPrice + (displayPrice * (productVAT/100))) %}
  626.                                 {% set displayPriceVATLabel = 'product.price_with_VAT'|trans %}
  627.                             {% else %}
  628.                                 {% set displayPriceVAT = (displayPrice - (displayPrice * (productVAT/100))) %}
  629.                                 {% set displayPriceVATLabel = 'product.price_without_VAT'|trans %}
  630.                             {% endif %}
  631.                             <div>
  632.                                 {% if priceOnRequest %}
  633.                                     <span class="onPriceRequest">
  634.                                 {{ 'system.on_request'|trans }}
  635.                             </span>
  636.                                 {% else %}
  637.                                     {{ displayPriceVAT }}
  638.                                     <span class="productDetailCurrency">
  639.                                 {{ app.session.get('eshopCurrency').currencyKey }}
  640.                             </span>
  641.                                 {% endif %}
  642.                             </div>
  643.                         </td>
  644.                         <td class="addCartPane">
  645.                             {% if eshop.isAsynchrounousShopping %}
  646.                                 <div class="productLISTBasket">
  647.                                     <form name="toCartForm" method="POST" action="#product_{{ productVariant.productId }}">
  648.                                         <input type="hidden" name="productId" value="{{ productVariant.productId }}">
  649.                                         <input type="hidden" name="productPrice" value="{{ displayPrice }}">
  650.                                         <input type="hidden" name="orderItemPriceBrutto" value="{{ displayPriceVAT }}">
  651.                                         <input type="hidden" name="productPackPrice" value="{{ displayPackPrice }}">
  652.                                         <input type="hidden" name="orderItemVAT" value="{{ productVAT }}">
  653.                                         <input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
  654.                                         <span class="unitUpdate">
  655.                          <input type="text" name="units" id="units_{{ productVariant.productId }}" value="{{ minValue }}" class="basketUnits" size="3">
  656.                        </span>
  657.                                         <span class="unitUpdate">
  658.                         <div class="unitUp"><a onclick="javascript:updateUnits('units_{{ productVariant.productId }}', {{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitUpLink">+</a></div>
  659.                         <div class="unitDown"><a onclick="javascript:updateUnits('units_{{ productVariant.productId }}', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
  660.                        </span>
  661.                                         <span class="unitUpdate">
  662.                         <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 }}')">
  663.                        </span>
  664.                                     </form>
  665.                                 </div>
  666.                             {% else %}
  667.                                 {# we display classical shopping flow #}
  668.                                 <div class="productLISTBasket">
  669.                                     <form name="toCartForm" method="POST" action="#product_{{ productVariant.productId }}">
  670.                                         <input type="hidden" name="productId" value="{{ productVariant.productId }}">
  671.                                         <input type="hidden" name="productPrice" value="{{ displayPrice }}">
  672.                                         <input type="hidden" name="orderItemPriceBrutto" value="{{ displayPriceVAT }}">
  673.                                         <input type="hidden" name="productPackPrice" value="{{ displayPackPrice }}">
  674.                                         <input type="hidden" name="orderItemVAT" value="{{ productVAT }}">
  675.                                         <input type="hidden" name="currencyKey" value="{{ app.session.get('eshopCurrency').currencyKey }}">
  676.                                         <span class="unitUpdate">
  677.                          <input type="text" name="units" id="units_{{ productVariant.productId }}" value="{{ minValue }}" class="basketUnits" size="3">
  678.                        </span>
  679.                                         <span class="unitUpdate">
  680.                         <div class="unitUp"><a onclick="javascript:updateUnits('units_{{ productVariant.productId }}', {{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitUpLink">+</a></div>
  681.                         <div class="unitDown"><a onclick="javascript:updateUnits('units_{{ productVariant.productId }}', -{{ minAdd }}, {{ minValue }});" href="javascript:void();" class="unitDownLink">-</a></div>
  682.                        </span>
  683.                                         <span class="unitUpdate">
  684.                         <input type="submit" name="basket" value="{{ 'eshop.to_basket'|trans }}" class="basketButton">
  685.                        </span>
  686.                                     </form>
  687.                                 </div>
  688.                             {% endif %}
  689.                         </td>
  690.                         <td class="variantValue"><a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/product/{{ productVariant.productId }}" class="productDetailLink">{{ 'product.detail'|trans }}</a></td>
  691.                         {% for parameter in productVariantParameters %}
  692.                             {% set variantParamVals = productVariantParameterValues[productVariantId] %}
  693.                             {% for paramVal in variantParamVals %}
  694.                                 {% if parameter.productParameterId == paramVal.productParameterId and paramVal.productParameterValue is defined %}
  695.                                     <td class="variantValue">{{ paramVal.productParameterValue }} </td>
  696.                                 {% endif %}
  697.                             {% endfor %}
  698.                         {% endfor %}
  699.                     </tr>
  700.                     {% set counter = counter + 1  %}
  701.                 {% endfor %}
  702.             </table>
  703.         </div>
  704.     {% endif %}
  705.     <!-- 3D gallery -->
  706.     {% if product.gallery3dId is defined and product.gallery3dId > 0 %}
  707.         <div class="productBasicInfoRow">{{ gallery3d|raw }}</div>
  708.     {% endif %}
  709.     {% endblock %}