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