custom/plugins/XioniXconfig/src/Resources/views/storefront/page/product-detail/buy-widget.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}
  2. {% block page_product_detail_buy_form %}
  3. {% endblock %}
  4. {% block page_product_detail_price %}
  5. {% set has_config = page.extensions.is_xconfig.has_configuration %}
  6. {% sw_include '@XioniXconfig/storefront/page/product-detail/x_breadcrumb.html.twig' with { context: context, category: page.product.seoCategory } only %}
  7.     <div class="x-product-detail-tabs">
  8.         <div class="x-product-detail-tab tab-price">
  9.             <button class="tab-button tab-active" type="button" value="price">Preis</button>
  10.         </div>
  11.         <div class="x-product-detail-tab tab-info">
  12.             <button class="tab-button" type="button" value="info">Kontakt</button>
  13.         </div>
  14.         <div class="x-product-detail-tab tab-manufacturer">
  15.             <button class="tab-button" type="button" value="manufacturer">Mengen %</button>
  16.         </div>
  17.     </div>
  18.     <div class="product-detail-tab-content" id="tab-price">
  19.         <div class="product-detail-price-container">
  20.             {% if page.product.productNumber %}
  21.                 <div class="product-detail-ordernumber-container">
  22.                     {% block page_product_detail_ordernumber_label %}
  23.                         <span class="product-detail-ordernumber-label">
  24.                             {{ "detail.productNumberLabel"|trans|sw_sanitize }}
  25.                         </span>
  26.                     {% endblock %}
  27.                     {% block page_product_detail_ordernumber %}
  28.                         <meta itemprop="productID"
  29.                               content="{{ page.product.id }}"/>
  30.                         <span class="product-detail-ordernumber"
  31.                               itemprop="sku">
  32.                             {{ page.product.productNumber }}
  33.                         </span>
  34.                     {% endblock %}
  35.                 </div>
  36.             {% endif %}    
  37.             <h1 class="x-product-atricle-name">{{ page.product.translated.name }}</h1>
  38.             <div class="netto-container">
  39.                 <div class="price-detail-netto-headline">Netto</div>
  40.                 {% sw_include '@Storefront/storefront/page/product-detail/buy-widget-price.html.twig' %}
  41.             </div>
  42.             <div class="brutto-container">
  43.                 <div class="price-detail-brutto-headline">Brutto</div>
  44.                 {% set brutto_price = page.product.calculatedPrice.unitPrice*1.19 %}
  45.                 <div class="product-detail-price-brutto">
  46.                     <span class="brutto-price-number">{{ brutto_price|currency }}</span> inkl. MwSt. inkl. Versandkosten
  47.                 </div>
  48.             </div>
  49.             <div class="product-detail-tax-container">
  50.                 {% if context.taxState == "gross" %}
  51.                     {% set taxText = "general.grossTaxInformation"|trans|sw_sanitize %}
  52.                 {% else %}
  53.                     {% set taxText = "general.netTaxInformation"|trans|sw_sanitize %}
  54.                 {% endif %}
  55.                 <p class="product-detail-tax">
  56.                     {% block page_product_detail_tax_link %}
  57.                         <a class="product-detail-tax-link"
  58.                            href="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}"
  59.                            title="{{ taxText }}"
  60.                            data-toggle="modal"
  61.                            data-url="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}">
  62.                             {{ taxText }}
  63.                         </a>
  64.                     {% endblock %}
  65.                 </p>
  66.             </div>
  67.             <div class="product-detail-delivery-information">
  68.             {% if page.product.productNumber == "TESTHEMD37001" %}
  69.                 <div class="dpp-title">
  70.                 <h2>DPP</h2>
  71.                 <p id="dpp_link">Link:</p>
  72.                 </div>
  73.             {% endif %}                 
  74.                 {% sw_include '@Storefront/storefront/component/delivery-information.html.twig' %} <p>Lieferzeit</p>
  75.             </div>
  76.             {% if page.product.productNumber == "parking3000" %}
  77.                 <p class="product-detail-start-add-hint"><span style="font-weight: bold">Hinweis:</span><br> Für die elektrischen Schranken empfehlen wir eine persönliche Beratung durch unsere Experten! 
  78.                 Sie sind Ihnen ebenso behilflich bei der Auswahl von Zubehör. Kontaktieren Sie uns direkt unter +49 (0) 2373 17809-0 oder per <a target="_blank" href="https://poller24.de/Shop-Service/Kontakt/">Kontaktformular</a>. 
  79.                 Gern können Sie auch erste Fragen im Konfigurator beantworten und uns Ihre Anfrage senden.</p>
  80.                 <span id="xconfig_start_description" style="font-weight: bold"></span>                
  81.             {% endif %}                 
  82.         </div>
  83.         {% if has_config %}
  84.         <div id="xconfig">
  85.             <div id="xconfig_body">
  86.             </div>
  87.             <div id="xconfig_footer">
  88.             </div>
  89.         </div>
  90.         {% endif %}
  91.         <div class="xconfig_end_block">
  92.             {% if has_config %}
  93.             <div class="x-chosen-article-box">
  94.                 <div class="table-detail-headline">Ausgewählte Produktvariante</div>
  95.                 <div class="x-chosen-article">
  96.                 Ausführung:
  97.                 <span class="xconfig_description"></span>
  98.                 </div>
  99.             </div>
  100. <!--             <div class="xprice_block">
  101.                 <div class="x-chosen-article-box">
  102.                     <div class="table-detail-headline">Übersicht</div>
  103.                     <div class="x-chosen-article">
  104.                     Ausführung:
  105.                     <span class="xconfig_description"></span>
  106.                     </div>
  107.                 </div> 
  108.             </div> -->
  109.             {% endif %}
  110.             <div class="col-14 x-buy-field" {% if not has_config %} style="position:inherit!important" {% endif %}>
  111.                 <div class="col-4 x-select" style="margin-right:0px!important">
  112.                     <select class="custom-select">
  113.                     {% for quantity in range(page.product.minPurchase, page.product.calculatedMaxPurchase, page.product.purchaseSteps) %}
  114.                         <option value="{{ quantity }}">
  115.                             {{ quantity }}
  116.                             {% if quantity == 1 %}
  117.                                 {% if page.product.translated.packUnit %} {{ page.product.translated.packUnit }}{% endif %}
  118.                             {% else %}
  119.                                 {% if page.product.translated.packUnitPlural %}
  120.                                     {{ page.product.translated.packUnitPlural }}
  121.                                 {% elseif page.product.translated.packUnit %}
  122.                                     {{ page.product.translated.packUnit }}
  123.                                 {% endif %}
  124.                             {% endif %}
  125.                         </option>
  126.                     {% endfor %}
  127.                     </select>  
  128.                 </div>
  129.             <div class="col-8 x-buttons">
  130.                     <button id="cart_primary" form="productDetailPageBuyProductForm" class="btn btn-primary btn-block btn-buy"
  131.                             title="{{ "detail.addProduct"|trans|striptags }}"
  132.                             aria-label="{{ "detail.addProduct"|trans|striptags }}">
  133.                         {{ "detail.addProduct"|trans|sw_sanitize }}
  134.                     </button>
  135.                     <a href="mailto:m.wette@pse-technik.de?subject=Anfrage für {{ page.product.translated.name }}&body=Ihr Firmenname: %0D%0A %0D%0A Ihr Vor- und Nachname: %0D%0A %0D%0A Ihre Telefonnummer: %0D%0A %0D%0A Ihre Nachricht: %0D%0A" id="detail-config-request" class="btn btn-primary btn-block btn-buy">
  136.                         Produkt anfragen {% sw_icon "envelope" %}</a>
  137.                     </a>
  138.             </div>   
  139.                 <div class="x-calc-table">
  140.                       <div class="x-calc-table-firstrow">
  141.                         <div class="x-calc-table-row1">Artikel</div>
  142.                         <div class="x-calc-table-row2">Menge</div>
  143.                         <div class="x-calc-table-row3">Preis</div>
  144.                         <div class="x-calc-table-row4"></div>
  145.                       </div>
  146.                       <div class="x-calc-table-secondrow lchline">
  147.                         <div class="x-calc-table-row1">{{ page.product.translated.name }}</div>
  148.                         <div id="x-main-article-qty" class="x-calc-table-row2">1</div>
  149.                         <div id="x-main-article-price" class="x-calc-table-row3">{{ page.product.calculatedPrice.unitPrice|currency }}*</div>
  150.                       </div>
  151.                 </div> 
  152.                 <div class="xprice-netto-row">
  153.                     <div class="price-detail-netto-headline-table">Gesamtpreis Netto</div>
  154.                     <div class="x-full-price">{{ page.product.calculatedPrice.unitPrice|currency }}*</div>
  155.                 </div>
  156.                 <div class="xprice-brutto-row">
  157.                     <div class="price-detail-brutto-headline-table">Gesamtpreis Brutto</div>
  158.                     <div class="x-full-price-brutto">{{ brutto_price|currency }}</div>
  159.                 </div>
  160.                 <div class="product-detail-tax-container-table">
  161.                     {% if context.taxState == "gross" %}
  162.                         {% set taxText = "general.grossTaxInformation"|trans|sw_sanitize %}
  163.                     {% else %}
  164.                         {% set taxText = "general.netTaxInformation"|trans|sw_sanitize %}
  165.                     {% endif %}
  166.                     <p class="product-detail-tax">
  167.                         <a class="product-detail-tax-link"
  168.                            href="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}"
  169.                            title="{{ taxText }}"
  170.                            data-toggle="modal"
  171.                            data-url="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}">
  172.                             {{ taxText }}
  173.                         </a>
  174.                     </p>
  175.                 </div>
  176.             </div>
  177.         {% if page.product.active %}
  178.             <div class="product-detail-form-container">
  179.                 {% sw_include '@Storefront/storefront/page/product-detail/buy-widget-form.html.twig' %}
  180.             </div>
  181.             <div class="product-detail-accessory-form-container">
  182.                 {% sw_include '@Storefront/storefront/page/product-detail/buy-widget-form-accessory.html.twig' %}
  183.             </div>    
  184.         {% endif %}
  185.         </div> 
  186.     </div>    
  187.     <div class="product-detail-tab-content" id="tab-info">
  188.         <p class="tab-info-headline">Ihre Ansprechpartner</p>
  189.         {% if page.product.productNumber == "parking" || page.product.productNumber == "industrial" ||
  190.         page.product.productNumber == "koloss" || page.product.productNumber == "solar" || page.product.productNumber == "parking3000" %}
  191.         <div class="tab-info-personcard">
  192.             <div class="tab-info-personcard-image">
  193.                 <img class="personcard-image" alt="Dubravka Bukna - Service, Wartung und Reparatur Bereich Absperrtechnik" src="/media/c9/6a/6e/1677056857/dubravka_bukna.jpg" alt="Frau Bukna" title="Frau Bukna">
  194.             </div>
  195.             <div class="tab-info-personcard-description">
  196.                 <p class="tab-info-personcard-description-name">Dubravka Bukna</p>
  197.                 <p class="tab-info-personcard-description-title">Ansprechpartner Absperrtechnik</p>
  198.                 <p class="tab-info-personcard-description-phone"><a title="+49 (0) 2373 17809-15" href="tel:+4923731780915">+49 (0) 2373 17809-15<br></a></p>
  199.                 <p class="tab-info-personcard-description-mail"><a title="E-Mail-Adresse Dubravka Bukna" href="mailto:d.bukna@pse-technik.de" target="_blank">d.bukna@pse-technik.de</a></p>
  200.             </div>
  201.         </div>
  202.         <div class="tab-info-personcard">
  203.             <div class="tab-info-personcard-image">
  204.                 <img class="personcard-image" alt="Sebastian Toth - Bereich Absperrtechnik/Zutrittskontrolle" src="/media/90/ef/af/1677056857/sebastian_toth.jpg" alt="Herr Toth" title="Herr Toth">
  205.             </div>
  206.             <div class="tab-info-personcard-description">
  207.                 <p class="tab-info-personcard-description-name">Sebastian Toth</p>
  208.                 <p class="tab-info-personcard-description-title">Ansprechpartner Absperrtechnik/Zutrittskontrolle</p>
  209.                 <p class="tab-info-personcard-description-phone"><a title="+49 (0) 2373 17809-10" href="tel:+4923731780910">+49 (0) 2373 17809-10<br></a></p>
  210.                 <p class="tab-info-personcard-description-mail"><a title="E-Mail-Adresse Sebastian Toth" href="mailto:s.toth@pse-technik.de" target="_blank">s.toth@pse-technik.de</a></p>
  211.             </div>
  212.         </div>        
  213.         {% else %}
  214.         <div class="tab-info-personcard">
  215.             <div class="tab-info-personcard-image">
  216.                 <img class="personcard-image" alt="Marion Wette - Produktmanagerin" src="/media/5f/67/80/1647334115/frau_wette.jpg" alt="Frau Wette" title="Frau Wette">
  217.             </div>
  218.             <div class="tab-info-personcard-description">
  219.                 <p class="tab-info-personcard-description-name">Marion Wette</p>
  220.                 <p class="tab-info-personcard-description-title">Produktmanagerin</p>
  221.                 <p class="tab-info-personcard-description-phone"><a title="+49 (0) 2373 17809-11" href="tel:+4923731780911">+49 (0) 2373 17809-11<br></a></p>
  222.                 <p class="tab-info-personcard-description-mail"><a title="E-Mail-Adresse Marion Wette" href="mailto:m.wette@pse-technik.de" target="_blank">m.wette@pse-technik.de</a></p>
  223.             </div>
  224.         </div>
  225.         <div class="tab-info-personcard">
  226.             <div class="tab-info-personcard-image">
  227.                 <img class="personcard-image" alt="Christian Preuß - Produktmanager" src="/media/f9/f0/29/1647334352/herr_preuss.jpg" alt="Herr Preuß" title="Herr Preuß">
  228.             </div>
  229.             <div class="tab-info-personcard-description">
  230.                 <p class="tab-info-personcard-description-name">Christian Preuß</p>
  231.                 <p class="tab-info-personcard-description-title">Produktmanager</p>
  232.                 <p class="tab-info-personcard-description-phone"><a title="+49 (0) 2373 17809-0" href="tel:+492373178090">+49 (0) 2373 17809-0
  233.                 </a></p>
  234.                 <p class="tab-info-personcard-description-mail"><a title="E-Mail-Adresse Christian Preuß" href="mailto:c.preuss@pse-technik.de" target="_blank">c.preuss@pse-technik.de</a><a title="+49 (0) 2373 17809-0" href="tel:+492373178090"></a></p>
  235.             </div>
  236.         </div>
  237.         {% endif %}
  238.         <div class="tab-info-personcard">
  239.             <div class="tab-info-personcard-image">
  240.                 <img class="personcard-image" alt="Florian Thier (Leiter Vetriebsinnendienst)" src="/media/cb/50/82/1647334507/herr_thier.jpg" alt="Herr Thier" title="Herr Thier">
  241.             </div>
  242.             <div class="tab-info-personcard-description">
  243.                 <p class="tab-info-personcard-description-name">Florian Thier</p>
  244.                 <p class="tab-info-personcard-description-title">Leiter Vetriebsinnendienst</p><p class="tab-info-personcard-description-phone"><a title="+49 (0) 2373 17809-0" href="tel:+492373178090">+49 (0) 2373 17809-0</a></p>
  245.                 <p class="tab-info-personcard-description-mail"><a title="E-Mail-Adresse Florian Thier" href="mailto:f.thier@pse-technik.de">f.thier@pse-technik.de</a><a title="+49 (0) 2373 17809-0" href="tel:+492373178090"></a></p>
  246.             </div>
  247.         </div>
  248.     </div>
  249.     
  250.     <div class="product-detail-tab-content" id="tab-manufacturer">
  251.         <p class="tab-info-headline">Fragen Sie unverbindlich die aktuellen Staffelpreise und Mengenrabatte für diesen Artikel an.</p>
  252.         <p></p>
  253.         <div class="discount-button-container">
  254.             <a href="mailto:m.wette@pse-technik.de?subject=Anfrage%20Mengenrabatt%20/%20Staffelpreise%20für%20Artikel%20{{ page.product.translated.name }} &amp;body=Guten%20Tag,%0D%0A%0D%0AAnfrage%20zu%20Artikel%20{{ page.product.translated.name }}.%0D%0A%0D%0AGewünschte%20Menge:">
  255.                 <button class="btn btn-primary btn-block btn-discount">E-Mail Anfrage stellen</button> 
  256.             </a>
  257.         </div>
  258.     </div>
  259.     {% if page.product.productNumber == "SchrankeS" || page.product.productNumber == "parking" || page.product.productNumber == "industrial" ||
  260.      page.product.productNumber == "koloss" || page.product.productNumber == "solar" %}
  261.     <script>
  262.         $("#cart_primary").hide();
  263.         $(".x-calc-table").hide();
  264.         $(".xprice-netto-row").hide();
  265.         $(".xprice-brutto-row").hide();
  266.         $(".x-select").hide();
  267.         $(".product-detail-tax-container-table").hide();
  268.         $(".netto-container").html('<meta itemprop="price" content="0"><p class="product-detail-price">Preis auf Anfrage</p><p>Wir erstellen Ihnen gern ein Angebot. Einfach konfigurieren und Produktberatung anfragen! Weitere Details klären wir in einem persönlichen Gespräch.</p>');
  269.         $(".netto-container").css({"float": "inherit", "width": "100%"});
  270.         //$(".netto-container").hide();
  271.         $(".brutto-container").hide();
  272.         $(".product-detail-delivery-information").hide();
  273.         $(".product-detail-tax-container").hide();
  274.         $(".xconfig_start_block").hide();
  275.         $(".x-chosen-article-box").hide();
  276.         $(".product-detail-ordernumber-container").hide();
  277.         $(".manufacturer-website").hide();
  278.         $("#detail-config-request").attr('href', 'mailto:d.bukna@pse-technik.de?subject=Anfrage für {{ page.product.translated.name }}&body=Ihr Firmenname: %0D%0A %0D%0A Ihr Vor- und Nachname: %0D%0A %0D%0A Ihre Telefonnummer: %0D%0A %0D%0A Ihre Nachricht: %0D%0A');
  279.         $( document ).ready(function() {
  280.             $("#x-order-tab").hide();
  281.         });
  282.     </script>
  283.     {% endif %}
  284.     {% if page.product.productNumber == "parking3000" %}
  285.     <script>
  286.         $("#detail-config-request").attr('href', 'mailto:d.bukna@pse-technik.de?subject=Anfrage für {{ page.product.translated.name }}&body=Ihr Firmenname: %0D%0A %0D%0A Ihr Vor- und Nachname: %0D%0A %0D%0A Ihre Telefonnummer: %0D%0A %0D%0A Ihre Nachricht: %0D%0A');
  287.         $(".manufacturer-website").hide();
  288.         $(".xconfig_start_block").hide();
  289.         $(".x-chosen-article-box").hide();
  290.     </script>
  291.     {% endif %}    
  292.     <script>
  293.     var groupIds     = new Array();
  294.     var groupValues    = new Array();
  295.     var start_variant = getSearchParams("xconfig");
  296.     var preconf = getSearchParams("preconf");
  297.     var num            = 0;    
  298.     var original_price = $(".product-detail-price").html();
  299.     var brutto_price = $(".product-detail-price-brutto").html();
  300.     var productnumber = "{{ page.product.productNumber }}";
  301.     var currency = "{{ context.currency.isoCode }}";                                                
  302.     var main_price = 0;
  303.     {% if not has_config %}
  304.     main_price = {{ page.product.calculatedPrice.unitPrice }};
  305.     {% endif %}
  306.     $( ".tab-button" ).click(function() {
  307.         var tab = $(this).attr("value");
  308.         $( ".tab-button" ).removeClass("tab-active");
  309.         $(this).addClass("tab-active");
  310.         $( ".product-detail-tab-content" ).css("display", "none");
  311.         $( "#tab-"+tab ).css("display", "block");
  312.         if (tab != "price") {
  313.             $( ".product-detail-form-container" ).hide();
  314.         } else {
  315.             $( ".product-detail-form-container" ).show();
  316.         }
  317.     });
  318.     
  319.     $( document ).ready(function() {
  320.         $.getScript("https://xconfig003.com/mvc_structure2/assets/js/jquery-ui.js", function() { 
  321.             getConfiguration(0, productnumber, groupIds, groupValues, start_variant);             
  322.         }); 
  323.         
  324.         $(".x-accessory-container:first .x-accessory-bottom-container").show(); 
  325.         $(".x-accessory-top-header-container").click(function () {
  326.             $(this).next(".x-accessory-bottom-container").slideToggle("slow");
  327.             $(".x-accessory-bottom-container").not($(this).next()).slideUp("slow");
  328.         }); 
  329.         
  330.          
  331.         $(".x-tab-accessory-top-header-container").click(function () {
  332.                 $(this).next(".x-tab-accessory-bottom-container").slideToggle("slow");
  333.             $(".x-tab-accessory-bottom-container").not($(this).next()).slideUp("slow");
  334.         }); 
  335.     });
  336.     
  337.     function getConfiguration(id, productnumber, option_ids, value_ids, start_variant) {
  338.         $.ajax({
  339.             url:"https://xconfig003.com/mvc_structure2/get_configuration_poller_new_config_DEV.php",
  340.             type:'POST',
  341.             dataType: 'json',
  342.             data: { id: id, productnumber: productnumber, option_ids: option_ids, value_ids: value_ids , start_variant: start_variant},
  343.             success: function(data){
  344.                 var main_tpl = decodeURIComponent(escape(window.atob(data.config_main_tpl)));
  345.                 var footer_tpl = decodeURIComponent(escape(window.atob(data.config_footer_tpl)));
  346.                 $('#xconfig_body').html(main_tpl);
  347.                 $('#xconfig_footer').html(footer_tpl);
  348.                 $('#xconfigDesc').val(data.config_description);
  349.                 var buy_btn = $('.btn-buy');
  350.                 var text = data.config_description;
  351.                 //text = text.replace("$$", "");
  352.                 //var newchar = ", %0D%0A";
  353.                 //text = text.split("$$").join(newchar);
  354.                 text = text.replaceAll(",", ", %0D%0A");
  355.                 if (text != "") {
  356.                     if (productnumber == "SchrankeS" || productnumber == "parking" || productnumber == "industrial" ||
  357.                         productnumber == "koloss" || productnumber == "solar" || productnumber == "parking3000") {
  358.                         $("#detail-config-request").attr('href',"mailto:d.bukna@pse-technik.de?subject=Anfrage für {{ page.product.translated.name }}&body=Ihr Firmenname: %0D%0A %0D%0A Ihr Vor- und Nachname: %0D%0A %0D%0A Ihre Telefonnummer: %0D%0A %0D%0A Ihre Konfiguration: %0D%0A"+ text + "%0D%0A Ihre Nachricht: %0D%0A");
  359.                     } else {
  360.                         $("#detail-config-request").attr('href',"mailto:m.wette@pse-technik.de?subject=Anfrage für {{ page.product.translated.name }}&body=Ihr Firmenname: %0D%0A %0D%0A Ihr Vor- und Nachname: %0D%0A %0D%0A Ihre Telefonnummer: %0D%0A %0D%0A Ihre Konfiguration: %0D%0A"+ text + "%0D%0A Ihre Nachricht: %0D%0A");
  361.                     }
  362.                     if (productnumber == "parking3000") {
  363.                         $("#cart_primary").hide();
  364.                         $(".x-calc-table").hide();
  365.                         $(".xprice-netto-row").hide();
  366.                         $(".xprice-brutto-row").hide();
  367.                         $(".x-select").hide();
  368.                         $(".product-detail-tax-container-table").hide();
  369.                         $(".netto-container").html('<p class="product-detail-price">Preis auf Anfrage</p><p>Wir erstellen Ihnen gern ein Angebot. Einfach konfigurieren und Produktberatung anfragen! Weitere Details klären wir in einem persönlichen Gespräch.</p>');
  370.                         $(".netto-container").css({"float": "inherit", "width": "100%"});
  371.                         //$(".netto-container").hide();
  372.                         $(".brutto-container").hide();
  373.                         $(".product-detail-delivery-information").hide();
  374.                         $(".product-detail-tax-container").hide();
  375.                         $(".xconfig_start_block").hide();
  376.                         $(".x-chosen-article-box").hide();
  377.                         $(".product-detail-ordernumber-container").hide();
  378.                         $(".manufacturer-website").hide();
  379.                         $( document ).ready(function() {
  380.                             $("#x-order-tab").hide();
  381.                         });                        
  382.                     }                    
  383.                 }
  384.                 value_ids.forEach (function (value_id, index) {
  385.                     if (value_id) {
  386.                         $( ".config--has-summary" ).show();
  387.                     }               
  388.                 });
  389.                 if(value_ids.length == 0) {
  390.                     $( ".config--has-summary" ).hide();
  391.                     if (preconf !== undefined) {
  392.                         searchAndTrigger(preconf);
  393.                     }                    
  394.                 }
  395.                 if(data.config_complete) {
  396.                     buy_btn.removeAttr('disabled');
  397.                 } else {
  398.                     buy_btn.attr('disabled', 'disabled');
  399.                 }
  400.                 if(productnumber == "TESTHEMD37001") {
  401.                     $("#dpp_link").html('Link: <a target="_blank" href="'+ data.dpp + '">Zum Produktpass</a>'); 
  402.                 }
  403.                 //if (data.variant_product_productnumber != null) {
  404.                 //    $("#xconfigProductNumber").html(data.variant_product_productnumber;
  405.                 //}
  406.                 //if (data.variant_product_ean != null) {
  407.                 //    $("#xconfigEan").html(data.variant_product_ean;
  408.                 //}
  409.                 var buy_form = $("#productDetailPageBuyProductForm");
  410.                 buy_form.attr("action", "/checkout/xconfig-line-item/add");
  411.                 if (productnumber != "parking3000") {
  412.                     if (data.variant_product_price1.raw != null) {
  413.                         main_price = data.variant_product_price1.raw;
  414.                         if (currency == "CHF") {
  415.                             $(".product-detail-price").html(data.variant_product_price1_chf.formatted);
  416.                             $("#x-main-article-price").html(data.variant_product_price1_chf.formatted);
  417.                             $(".product-detail-price-brutto").html("<span class='brutto-price-number'>" + data.variant_product_price1_brutto_chf.formatted + "</span><br>inkl. MwSt.");                   
  418.                         } else {
  419.                             $(".product-detail-price").html(data.variant_product_price1.formatted);
  420.                             $("#x-main-article-price").html(data.variant_product_price1.formatted);
  421.                             $(".product-detail-price-brutto").html("<span class='brutto-price-number'>" + data.variant_product_price1_brutto.formatted + "</span><br>inkl. MwSt.");
  422.                         }
  423.                         calcprice();
  424.                     }
  425.                 }
  426.                 $(".xconfig_description").html(data.config_product_description);
  427.                 // if (data.variant_product_media != "") {
  428.                     // var gallery_image = $(".gallery-slider-image").first();
  429.                     // $('#xconfigMedia').val(data.variant_product_media[0].media_path);
  430.                     // gallery_image.attr("src", data.variant_product_media[0].media_path.replace(/ /g, '%20'));
  431.                     // gallery_image.attr("srcset", data.variant_product_media[0].media_path.replace(/ /g, '%20')+" 1921w, "+data.variant_product_media[0].media_path.replace(/ /g, '%20')+" 1920w, "+data.variant_product_media[0].media_path.replace(/ /g, '%20')+" 800w, "+data.variant_product_media[0].media_path.replace(/ /g, '%20')+" 400w");
  432.                     // gallery_image.attr("data-full-image", data.variant_product_media[0].media_path.replace(/ /g, '%20'));
  433.                     // $( ".product-media-append" ).hide();
  434.                 // } else {
  435.                 //if(data.config_complete) {
  436.                 //    $( ".product-media-append" ).show();
  437.                 //} else {
  438.                 //    $( ".product-media-append" ).hide();
  439.                 //}
  440.                 
  441.                 // }
  442.                 if (productnumber == "SchrankeS" || productnumber == "parking" || productnumber == "industrial" ||
  443.                     productnumber == "koloss" || productnumber == "solar" || productnumber == "parking3000") {
  444.                 
  445.                 } else {
  446.                     var item_pdf = "";
  447.                     if (data.variant_product_media != "") {
  448.                         data.variant_product_media.forEach(function(item){
  449.                             if(item.media_path.includes('pdf')) {
  450.                                 item_pdf = item_pdf +  '<a class="pdf-media-download" target="_blank" rel="noopener noreferrer" href="'+ item.media_path +'">Download: '+ item.media_name +'.pdf</a> <br />';  
  451.                             }
  452.                         });
  453.                         $("#pdf-media").html(item_pdf);                
  454.                     }
  455.                     if (item_pdf == "") {
  456.                         $("#pdf-media").html('Leider gibt es für diesen Artikel bzw. für die von Ihnen gewählte Variante bisher keine Datenblätter. Sie können jedoch unter 0 23 73 / 1 78 09-11 oder <a href="mailto:m.wette@pse-technik.de" target="_self">m.wette@pse-technik.de</a> bei Frau Wette eine Anfrage für ein Datenblatt stellen oder weitere Informationen zu diesem Produkt einholen.');
  457.                     }
  458.                 }
  459.                 if(data.variant_product_start_config.values != "" && data.variant_product_start_config.options != "") {
  460.                     $("#xStartGroupValues").val(data.variant_product_start_config.values);
  461.                     $("#xStartGroupIds").val(data.variant_product_start_config.options); 
  462.                     $("#xconfig_start_description").html(data.variant_product_start_config_description);
  463.                     $('#xconfigStartDesc').val(data.variant_product_start_config_description);                    
  464.                     $('#startCartBtn').removeAttr('disabled');
  465.                     $("#xGroupIds").val(data.variant_product_start_config.values);
  466.                     $("#xGroupValues").val(data.variant_product_start_config.options); 
  467.                     $('#xconfigDesc').val(data.variant_product_start_config_description);                    
  468.                     buy_btn.removeAttr('disabled');                    
  469.                 } else {
  470.                     $('#startCartBtn').attr('disabled', 'disabled');
  471.                     $('.xconfig_start_block').hide();
  472.                 }
  473.                 if (main_tpl == "") {
  474.                     $('#startCartBtn').hide();
  475.                     $('.xconfig_start_block').hide();
  476.                 }
  477.                 //$(".accessory-hidden-input-id").each(function(e){
  478.                 //    this.value = data.variant_id + $(this).attr("originalid");
  479.                 //});
  480.                 $('.x-accessory-item-container').hide();
  481.                 $('.x-accessories-headline').hide();
  482.                 
  483.                 // if (data.product_accessories != "") {
  484.                     // //$('.x-accessory-item-container').hide();
  485.                     // data.product_accessories.forEach(function(item){
  486.                         // var product_number = item.product.base.product_number;
  487.                         // product_number = product_number.replace(".", "_")
  488.                         // $('#accessory_'+product_number).show();
  489.                         // $('.x-accessories-headline').show();
  490.                     // });
  491.                 // }
  492.                 
  493.                 if (data.variant_product_accessories != "") {
  494.                     //$('.x-accessory-item-container').hide();
  495.                     data.variant_product_accessories.forEach(function(item){
  496.                         var product_number = item.product.base.product_number;
  497.                         product_number = product_number.replace(".", "_")
  498.                         $('#accessory_'+product_number).show();
  499.                         $('.x-accessories-headline').show();
  500.                     });
  501.                 }                
  502.                 // if (data.variant_product_accessories == "" || data.product_accessories == "") {
  503.                     // $('.x-accessories-headline').hide();
  504.                     // $('.x-accessory-item-container').hide();
  505.                 // }
  506.                 $("#xVariantId").val(data.variant_id);
  507.                 $(".accessory-variant-id").val(data.variant_id);
  508.                 
  509.                 if (productnumber == "SchrankeS" || productnumber == "parking" || productnumber == "industrial" ||
  510.                     productnumber == "koloss" || productnumber == "solar") {
  511.                     $(".product--headline").html("Konfigurieren Sie jetzt Ihre Anfrage:");
  512.                 }
  513.                 
  514.                 if (productnumber == "parking3000") {
  515.                     $(".product--headline").html("Konfigurieren Sie jetzt Ihren Anfrage:");
  516.                     buy_btn.removeAttr('disabled');
  517.                 }
  518.                 var steps = value_ids.filter(obj => obj != "").length;
  519.                 if (steps != 0) {
  520.                     gtag('event', 'Konfigurator: '+productnumber, {'event_category': 'configuration','event_label': 'Schritt:'+steps,'value': true});
  521.                     //gtag('event', 'Konfigurator: '+productnumber, {
  522.                     //  'SCHRITT': steps
  523.                     //});                    
  524.                 }                 
  525.             }
  526.         });    
  527.     }    
  528.     
  529.     function submitXData() {
  530.         $("#xconfig_body :input[name^='group']").each(function(e){
  531.             if(this.type == "hidden" || this.type == "text")
  532.             {
  533.                 string = this.name;
  534.                 string = string.substring(string.lastIndexOf("[")+1,string.lastIndexOf("]"));
  535.                 groupIds[num] = string;
  536.                 groupValues[num] = this.value;
  537.                 num++;
  538.             }
  539.         });
  540.         $("#xGroupIds").val(groupIds);
  541.         $("#xGroupValues").val(groupValues);
  542.         
  543.         getConfiguration(0, productnumber, groupIds, groupValues);
  544.         
  545.         groupIds = [];
  546.         groupValues = [];
  547.         num = 0;
  548.         return false;
  549.     }
  550.     function getSearchParams(k){
  551.         var p={};
  552.         location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(s,k,v){p[k]=v})
  553.         return k?p[k]:p;
  554.     }                                
  555.     
  556.     function submitRestart() {
  557.         var groupIds     = new Array();
  558.         var groupValues = new Array();
  559.         config_count = 0;
  560.         getConfiguration(0, productnumber, groupIds, groupValues);
  561.         $('#startCartBtn').removeAttr('disabled');
  562.         $('.xconfig_start_block').show();
  563.         $(".product-detail-price").html(original_price);   
  564.         $("#x-main-article-price").html(original_price);   
  565.         $(".product-detail-price-brutto").html(brutto_price);   
  566.     }
  567.     
  568.     function calcprice() {
  569.         var main_qty = $( ".custom-select option:selected" ).text();
  570.         var fullprice = main_qty * main_price;
  571.         $('.x-accessory-item').each(function() {
  572.             if($( this ).hasClass("active")) {
  573.                 accessory_price = $( this ).attr("data-price");
  574.                 accessory_qty = $( this ).attr("data-qty");
  575.                 full_accessory = accessory_price * accessory_qty;
  576.                 fullprice = fullprice + full_accessory;
  577.             } 
  578.         });
  579.         if (currency == "CHF") {
  580.             fullprice_brutto = fullprice * 1.077;
  581.             fullprice_brutto = formatPrice(fullprice_brutto, "CHF")
  582.             fullprice = formatPrice(fullprice, "CHF*")
  583.         } else {
  584.             fullprice_brutto = fullprice * 1.19;
  585.             fullprice_brutto = formatPrice(fullprice_brutto, "€")
  586.             fullprice = formatPrice(fullprice, "€*")            
  587.         }
  588.         $(".x-full-price").html(fullprice);  
  589.         $(".x-full-price-brutto").html(fullprice_brutto);  
  590.     }
  591.         
  592.     function formatPrice(num, currency) { 
  593.         var p = Number(num).toFixed(2).split("."); 
  594.         return p[0].split("").reverse().reduce(function(acc, num, i, orig) 
  595.         { 
  596.             return num + (i && !(i % 3) ? "." : "") + acc; 
  597.         } , "") + "," + p[1] + " "+ currency; 
  598.     } 
  599.     // Function to search for the option and trigger onchange if found
  600.     function searchAndTrigger(preconf) {
  601.         var selectElements = document.querySelectorAll('.config_select'); // Select by class name
  602.         var searchterm;
  603.         if (preconf == "of") {
  604.             searchTerm = 'ortsfest';
  605.         }
  606.         if (preconf == "hn") {
  607.             searchTerm = 'herausnehmbar';
  608.         } 
  609.         if (preconf == "ul") {
  610.             searchTerm = 'umlegbar';
  611.         }         
  612.         var triggered = false;
  613.         selectElements.forEach(function (selectElement) {
  614.             if (triggered) {
  615.                 return;
  616.             }
  617.             // Enable the select field temporarily
  618.             selectElement.disabled = false;
  619.             for (var i = 0; i < selectElement.options.length; i++) {
  620.                 var option = selectElement.options[i];
  621.                 if (option.innerHTML.toLowerCase().includes(searchTerm)) {
  622.                     // Option found, trigger onchange
  623.                     selectElement.value = option.value;
  624.                     xSend(selectElement); // Pass the select element as a parameter
  625.                     triggered = true; // Set the flag to true
  626.                     break;
  627.                 }
  628.             }
  629.         });
  630.     }
  631.     
  632.     $("#x_info_click").click(function () {
  633.         $('#x_info_modal').addClass("show"); 
  634.     });
  635.     $(".x-modal-dialog .x-dialog-close").click(function(){
  636.         
  637.         $(this).closest(".x-modal-dialog").removeClass("show");
  638.         
  639.     });    
  640. </script>       
  641. {% endblock %}
  642. {% block page_product_detail_delivery_informations %}
  643. {% endblock %}
  644. {% block page_product_detail_tax %}
  645. {% endblock %}
  646. {% block page_product_detail_ordernumber_container %} 
  647.     {% for shop_detail in page.extensions.xconfig.product.data.shop_details %}
  648.         {% if shop_detail.type_id == "2" %}
  649.             <button class="xaccordion">{{ shop_detail.item_name }}</button>
  650.             <div class="xpanel">
  651.                 <p>{{ shop_detail.item_value|raw }}</p>
  652.             </div>                            
  653.         {% endif %}
  654.     {% endfor %}    
  655. <script>
  656. var icon_delete_html = '<span class="icon icon-trash" title="entfernen"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#f01d4a" fill-rule="evenodd" d="M5 21c0 .5523.4477 1 1 1h12c.5523 0 1-.4477 1-1V9H5v12zM17 3h2c1.6569 0 3 1.3431 3 3v2c0 .5523-.4477 1-1 1v12c0 1.6569-1.3431 3-3 3H6c-1.6569 0-3-1.3431-3-3V9c-.5523 0-1-.4477-1-1V6c0-1.6569 1.3431-3 3-3h2c0-1.6569 1.3431-3 3-3h4c1.6569 0 3 1.3431 3 3zM7 13v5c0 .5523.4477 1 1 1s1-.4477 1-1v-5c0-.5523-.4477-1-1-1s-1 .4477-1 1zm4 0v5c0 .5523.4477 1 1 1s1-.4477 1-1v-5c0-.5523-.4477-1-1-1s-1 .4477-1 1zm4 0v5c0 .5523.4477 1 1 1s1-.4477 1-1v-5c0-.5523-.4477-1-1-1s-1 .4477-1 1zM10 2c-.5523 0-1 .4477-1 1h6c0-.5523-.4477-1-1-1h-4zM4 7h16V6c0-.5523-.4477-1-1-1H5c-.5523 0-1 .4477-1 1v1z"/></svg></span>';
  657. $( ".xaccordion" ).click(function() {
  658.     this.classList.toggle("xactive");
  659.     var panel = this.nextElementSibling;
  660.     if (panel.style.maxHeight) {
  661.       panel.style.maxHeight = null;
  662.     } else {
  663.       panel.style.maxHeight = panel.scrollHeight + "px";
  664.     }
  665. });
  666. $('.cms-element-').css({                      
  667.     position: 'sticky',
  668.     top: '140px'
  669. });
  670. $( ".gallery-slider-image" ).click(function() {
  671.     $('.cms-element-').css({                      
  672.         position: 'relative'
  673.     });
  674. });
  675. $( ".modal-close" ).click(function() {
  676.     $('.cms-element-').css({                      
  677.         position: 'sticky'
  678.     });
  679. });
  680. $( ".custom-select" ).change(function() {
  681.     $('#x-main-article-qty').html(this.value);
  682.     $('#main_article_quantity_form').val(this.value);
  683.     calcprice();
  684. });
  685. // $( ".x-accessory-item-select" ).change(function() {
  686.     // var parent = $( this ).parents(".x-accessory-item");
  687.     // parent.attr("data-qty", this.value)
  688.     // $( "#x-acc-article-qty-"+ parent.attr("data-id") ).html(this.value);
  689.     // calcprice();
  690. // });
  691. // $(".x-accessory-item-input").click(function() {
  692.     // var parent = $( this ).parents(".x-accessory-item");
  693.     // acc_qty = parent.attr("data-qty");
  694.     // acc_price = parent.attr("data-price");
  695.     // acc_price = formatPrice(acc_price, "€*");
  696.     // acc_name = parent.attr("data-name");
  697.     // acc_id = parent.attr("data-id");    
  698.     // if(!parent.hasClass("active")) {
  699.         // parent.addClass("active");
  700.         // parent.find(".accessory-hidden-input").each(function() { 
  701.             // $( this ).removeAttr("disabled");
  702.         // });
  703.         
  704.         // $('.x-calc-table').append('<div class="x-acc-article lchline visible" id="x-acc-article-'+ acc_id +'"><div class="x-acc-article-name" id="x-acc-article-name'+ acc_id +'">'+ acc_name +'</div><div class="x-acc-article-qty" id="x-acc-article-qty-'+ acc_id +'">'+ acc_qty +'</div><div class="x-acc-article-price" id="x-acc-article-price'+ acc_id +'">'+ acc_price +'</div><div style="cursor: pointer;" onclick="article_delete('+ "'" + acc_id + "'" +')" class="x-article-delete"><span class="x-article-icon-delete"'+ icon_delete_html +'</span></div></div>');        
  705.     // } else {
  706.         // parent.removeClass("active");
  707.         // parent.find(".accessory-hidden-input").each(function() {
  708.             // $( this ).attr("disabled", true);
  709.         // });
  710.         // $( "#x-acc-article-"+ acc_id ).remove();
  711.     // }
  712.     // calcprice();  
  713. // }); 
  714. function article_delete(acc_id) {
  715.     $("#acc_input_"+ acc_id ).click();
  716. }    
  717.     
  718. $( "#show-more-accessory" ).click(function() {
  719.   $( '.x-accessories-rest' ).show( "slow" );
  720.   $( '#show-more-accessory' ).hide();
  721. });
  722. $( "#show-less-accessory" ).click(function() {
  723.   $( '.x-accessories-rest' ).hide( "slow" );
  724.   $( '#show-more-accessory' ).show();
  725.   $('html, body').animate({
  726.         scrollTop: parseInt($('.x-accessories-headline').offset().top)
  727.     }, 500);
  728. });
  729.     
  730. function accessoryCheck() {
  731.   let total = document.querySelectorAll('.x-accessory-item-input:checked').length;
  732.   document.getElementById("totalaccessory").innerHTML = "ausgewählte Zubehörartikel: " + total;
  733. }
  734. </script>
  735. {% endblock %}