{% sw_extends '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}
{% block page_product_detail_buy_form %}
{% endblock %}
{% block page_product_detail_price %}
{% set has_config = page.extensions.is_xconfig.has_configuration %}
{% sw_include '@XioniXconfig/storefront/page/product-detail/x_breadcrumb.html.twig' with { context: context, category: page.product.seoCategory } only %}
<div class="x-product-detail-tabs">
<div class="x-product-detail-tab tab-price">
<button class="tab-button tab-active" type="button" value="price">Preis</button>
</div>
<div class="x-product-detail-tab tab-info">
<button class="tab-button" type="button" value="info">Kontakt</button>
</div>
<div class="x-product-detail-tab tab-manufacturer">
<button class="tab-button" type="button" value="manufacturer">Mengen %</button>
</div>
</div>
<div class="product-detail-tab-content" id="tab-price">
<div class="product-detail-price-container">
{% if page.product.productNumber %}
<div class="product-detail-ordernumber-container">
{% block page_product_detail_ordernumber_label %}
<span class="product-detail-ordernumber-label">
{{ "detail.productNumberLabel"|trans|sw_sanitize }}
</span>
{% endblock %}
{% block page_product_detail_ordernumber %}
<meta itemprop="productID"
content="{{ page.product.id }}"/>
<span class="product-detail-ordernumber"
itemprop="sku">
{{ page.product.productNumber }}
</span>
{% endblock %}
</div>
{% endif %}
<h1 class="x-product-atricle-name">{{ page.product.translated.name }}</h1>
<div class="netto-container">
<div class="price-detail-netto-headline">Netto</div>
{% sw_include '@Storefront/storefront/page/product-detail/buy-widget-price.html.twig' %}
</div>
<div class="brutto-container">
<div class="price-detail-brutto-headline">Brutto</div>
{% set brutto_price = page.product.calculatedPrice.unitPrice*1.19 %}
<div class="product-detail-price-brutto">
<span class="brutto-price-number">{{ brutto_price|currency }}</span> inkl. MwSt. inkl. Versandkosten
</div>
</div>
<div class="product-detail-tax-container">
{% if context.taxState == "gross" %}
{% set taxText = "general.grossTaxInformation"|trans|sw_sanitize %}
{% else %}
{% set taxText = "general.netTaxInformation"|trans|sw_sanitize %}
{% endif %}
<p class="product-detail-tax">
{% block page_product_detail_tax_link %}
<a class="product-detail-tax-link"
href="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}"
title="{{ taxText }}"
data-toggle="modal"
data-url="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}">
{{ taxText }}
</a>
{% endblock %}
</p>
</div>
<div class="product-detail-delivery-information">
{% if page.product.productNumber == "TESTHEMD37001" %}
<div class="dpp-title">
<h2>DPP</h2>
<p id="dpp_link">Link:</p>
</div>
{% endif %}
{% sw_include '@Storefront/storefront/component/delivery-information.html.twig' %} <p>Lieferzeit</p>
</div>
{% if page.product.productNumber == "parking3000" %}
<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!
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>.
Gern können Sie auch erste Fragen im Konfigurator beantworten und uns Ihre Anfrage senden.</p>
<span id="xconfig_start_description" style="font-weight: bold"></span>
{% endif %}
</div>
{% if has_config %}
<div id="xconfig">
<div id="xconfig_body">
</div>
<div id="xconfig_footer">
</div>
</div>
{% endif %}
<div class="xconfig_end_block">
{% if has_config %}
<div class="x-chosen-article-box">
<div class="table-detail-headline">Ausgewählte Produktvariante</div>
<div class="x-chosen-article">
Ausführung:
<span class="xconfig_description"></span>
</div>
</div>
<!-- <div class="xprice_block">
<div class="x-chosen-article-box">
<div class="table-detail-headline">Übersicht</div>
<div class="x-chosen-article">
Ausführung:
<span class="xconfig_description"></span>
</div>
</div>
</div> -->
{% endif %}
<div class="col-14 x-buy-field" {% if not has_config %} style="position:inherit!important" {% endif %}>
<div class="col-4 x-select" style="margin-right:0px!important">
<select class="custom-select">
{% for quantity in range(page.product.minPurchase, page.product.calculatedMaxPurchase, page.product.purchaseSteps) %}
<option value="{{ quantity }}">
{{ quantity }}
{% if quantity == 1 %}
{% if page.product.translated.packUnit %} {{ page.product.translated.packUnit }}{% endif %}
{% else %}
{% if page.product.translated.packUnitPlural %}
{{ page.product.translated.packUnitPlural }}
{% elseif page.product.translated.packUnit %}
{{ page.product.translated.packUnit }}
{% endif %}
{% endif %}
</option>
{% endfor %}
</select>
</div>
<div class="col-8 x-buttons">
<button id="cart_primary" form="productDetailPageBuyProductForm" class="btn btn-primary btn-block btn-buy"
title="{{ "detail.addProduct"|trans|striptags }}"
aria-label="{{ "detail.addProduct"|trans|striptags }}">
{{ "detail.addProduct"|trans|sw_sanitize }}
</button>
<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">
Produkt anfragen {% sw_icon "envelope" %}</a>
</a>
</div>
<div class="x-calc-table">
<div class="x-calc-table-firstrow">
<div class="x-calc-table-row1">Artikel</div>
<div class="x-calc-table-row2">Menge</div>
<div class="x-calc-table-row3">Preis</div>
<div class="x-calc-table-row4"></div>
</div>
<div class="x-calc-table-secondrow lchline">
<div class="x-calc-table-row1">{{ page.product.translated.name }}</div>
<div id="x-main-article-qty" class="x-calc-table-row2">1</div>
<div id="x-main-article-price" class="x-calc-table-row3">{{ page.product.calculatedPrice.unitPrice|currency }}*</div>
</div>
</div>
<div class="xprice-netto-row">
<div class="price-detail-netto-headline-table">Gesamtpreis Netto</div>
<div class="x-full-price">{{ page.product.calculatedPrice.unitPrice|currency }}*</div>
</div>
<div class="xprice-brutto-row">
<div class="price-detail-brutto-headline-table">Gesamtpreis Brutto</div>
<div class="x-full-price-brutto">{{ brutto_price|currency }}</div>
</div>
<div class="product-detail-tax-container-table">
{% if context.taxState == "gross" %}
{% set taxText = "general.grossTaxInformation"|trans|sw_sanitize %}
{% else %}
{% set taxText = "general.netTaxInformation"|trans|sw_sanitize %}
{% endif %}
<p class="product-detail-tax">
<a class="product-detail-tax-link"
href="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}"
title="{{ taxText }}"
data-toggle="modal"
data-url="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}">
{{ taxText }}
</a>
</p>
</div>
</div>
{% if page.product.active %}
<div class="product-detail-form-container">
{% sw_include '@Storefront/storefront/page/product-detail/buy-widget-form.html.twig' %}
</div>
<div class="product-detail-accessory-form-container">
{% sw_include '@Storefront/storefront/page/product-detail/buy-widget-form-accessory.html.twig' %}
</div>
{% endif %}
</div>
</div>
<div class="product-detail-tab-content" id="tab-info">
<p class="tab-info-headline">Ihre Ansprechpartner</p>
{% if page.product.productNumber == "parking" || page.product.productNumber == "industrial" ||
page.product.productNumber == "koloss" || page.product.productNumber == "solar" || page.product.productNumber == "parking3000" %}
<div class="tab-info-personcard">
<div class="tab-info-personcard-image">
<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">
</div>
<div class="tab-info-personcard-description">
<p class="tab-info-personcard-description-name">Dubravka Bukna</p>
<p class="tab-info-personcard-description-title">Ansprechpartner Absperrtechnik</p>
<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>
<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>
</div>
</div>
<div class="tab-info-personcard">
<div class="tab-info-personcard-image">
<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">
</div>
<div class="tab-info-personcard-description">
<p class="tab-info-personcard-description-name">Sebastian Toth</p>
<p class="tab-info-personcard-description-title">Ansprechpartner Absperrtechnik/Zutrittskontrolle</p>
<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>
<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>
</div>
</div>
{% else %}
<div class="tab-info-personcard">
<div class="tab-info-personcard-image">
<img class="personcard-image" alt="Marion Wette - Produktmanagerin" src="/media/5f/67/80/1647334115/frau_wette.jpg" alt="Frau Wette" title="Frau Wette">
</div>
<div class="tab-info-personcard-description">
<p class="tab-info-personcard-description-name">Marion Wette</p>
<p class="tab-info-personcard-description-title">Produktmanagerin</p>
<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>
<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>
</div>
</div>
<div class="tab-info-personcard">
<div class="tab-info-personcard-image">
<img class="personcard-image" alt="Christian Preuß - Produktmanager" src="/media/f9/f0/29/1647334352/herr_preuss.jpg" alt="Herr Preuß" title="Herr Preuß">
</div>
<div class="tab-info-personcard-description">
<p class="tab-info-personcard-description-name">Christian Preuß</p>
<p class="tab-info-personcard-description-title">Produktmanager</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>
<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>
</div>
</div>
{% endif %}
<div class="tab-info-personcard">
<div class="tab-info-personcard-image">
<img class="personcard-image" alt="Florian Thier (Leiter Vetriebsinnendienst)" src="/media/cb/50/82/1647334507/herr_thier.jpg" alt="Herr Thier" title="Herr Thier">
</div>
<div class="tab-info-personcard-description">
<p class="tab-info-personcard-description-name">Florian Thier</p>
<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>
<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>
</div>
</div>
</div>
<div class="product-detail-tab-content" id="tab-manufacturer">
<p class="tab-info-headline">Fragen Sie unverbindlich die aktuellen Staffelpreise und Mengenrabatte für diesen Artikel an.</p>
<p></p>
<div class="discount-button-container">
<a href="mailto:m.wette@pse-technik.de?subject=Anfrage%20Mengenrabatt%20/%20Staffelpreise%20für%20Artikel%20{{ page.product.translated.name }} &body=Guten%20Tag,%0D%0A%0D%0AAnfrage%20zu%20Artikel%20{{ page.product.translated.name }}.%0D%0A%0D%0AGewünschte%20Menge:">
<button class="btn btn-primary btn-block btn-discount">E-Mail Anfrage stellen</button>
</a>
</div>
</div>
{% if page.product.productNumber == "SchrankeS" || page.product.productNumber == "parking" || page.product.productNumber == "industrial" ||
page.product.productNumber == "koloss" || page.product.productNumber == "solar" %}
<script>
$("#cart_primary").hide();
$(".x-calc-table").hide();
$(".xprice-netto-row").hide();
$(".xprice-brutto-row").hide();
$(".x-select").hide();
$(".product-detail-tax-container-table").hide();
$(".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>');
$(".netto-container").css({"float": "inherit", "width": "100%"});
//$(".netto-container").hide();
$(".brutto-container").hide();
$(".product-detail-delivery-information").hide();
$(".product-detail-tax-container").hide();
$(".xconfig_start_block").hide();
$(".x-chosen-article-box").hide();
$(".product-detail-ordernumber-container").hide();
$(".manufacturer-website").hide();
$("#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');
$( document ).ready(function() {
$("#x-order-tab").hide();
});
</script>
{% endif %}
{% if page.product.productNumber == "parking3000" %}
<script>
$("#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');
$(".manufacturer-website").hide();
$(".xconfig_start_block").hide();
$(".x-chosen-article-box").hide();
</script>
{% endif %}
<script>
var groupIds = new Array();
var groupValues = new Array();
var start_variant = getSearchParams("xconfig");
var preconf = getSearchParams("preconf");
var num = 0;
var original_price = $(".product-detail-price").html();
var brutto_price = $(".product-detail-price-brutto").html();
var productnumber = "{{ page.product.productNumber }}";
var currency = "{{ context.currency.isoCode }}";
var main_price = 0;
{% if not has_config %}
main_price = {{ page.product.calculatedPrice.unitPrice }};
{% endif %}
$( ".tab-button" ).click(function() {
var tab = $(this).attr("value");
$( ".tab-button" ).removeClass("tab-active");
$(this).addClass("tab-active");
$( ".product-detail-tab-content" ).css("display", "none");
$( "#tab-"+tab ).css("display", "block");
if (tab != "price") {
$( ".product-detail-form-container" ).hide();
} else {
$( ".product-detail-form-container" ).show();
}
});
$( document ).ready(function() {
$.getScript("https://xconfig003.com/mvc_structure2/assets/js/jquery-ui.js", function() {
getConfiguration(0, productnumber, groupIds, groupValues, start_variant);
});
$(".x-accessory-container:first .x-accessory-bottom-container").show();
$(".x-accessory-top-header-container").click(function () {
$(this).next(".x-accessory-bottom-container").slideToggle("slow");
$(".x-accessory-bottom-container").not($(this).next()).slideUp("slow");
});
$(".x-tab-accessory-top-header-container").click(function () {
$(this).next(".x-tab-accessory-bottom-container").slideToggle("slow");
$(".x-tab-accessory-bottom-container").not($(this).next()).slideUp("slow");
});
});
function getConfiguration(id, productnumber, option_ids, value_ids, start_variant) {
$.ajax({
url:"https://xconfig003.com/mvc_structure2/get_configuration_poller_new_config_DEV.php",
type:'POST',
dataType: 'json',
data: { id: id, productnumber: productnumber, option_ids: option_ids, value_ids: value_ids , start_variant: start_variant},
success: function(data){
var main_tpl = decodeURIComponent(escape(window.atob(data.config_main_tpl)));
var footer_tpl = decodeURIComponent(escape(window.atob(data.config_footer_tpl)));
$('#xconfig_body').html(main_tpl);
$('#xconfig_footer').html(footer_tpl);
$('#xconfigDesc').val(data.config_description);
var buy_btn = $('.btn-buy');
var text = data.config_description;
//text = text.replace("$$", "");
//var newchar = ", %0D%0A";
//text = text.split("$$").join(newchar);
text = text.replaceAll(",", ", %0D%0A");
if (text != "") {
if (productnumber == "SchrankeS" || productnumber == "parking" || productnumber == "industrial" ||
productnumber == "koloss" || productnumber == "solar" || productnumber == "parking3000") {
$("#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");
} else {
$("#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");
}
if (productnumber == "parking3000") {
$("#cart_primary").hide();
$(".x-calc-table").hide();
$(".xprice-netto-row").hide();
$(".xprice-brutto-row").hide();
$(".x-select").hide();
$(".product-detail-tax-container-table").hide();
$(".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>');
$(".netto-container").css({"float": "inherit", "width": "100%"});
//$(".netto-container").hide();
$(".brutto-container").hide();
$(".product-detail-delivery-information").hide();
$(".product-detail-tax-container").hide();
$(".xconfig_start_block").hide();
$(".x-chosen-article-box").hide();
$(".product-detail-ordernumber-container").hide();
$(".manufacturer-website").hide();
$( document ).ready(function() {
$("#x-order-tab").hide();
});
}
}
value_ids.forEach (function (value_id, index) {
if (value_id) {
$( ".config--has-summary" ).show();
}
});
if(value_ids.length == 0) {
$( ".config--has-summary" ).hide();
if (preconf !== undefined) {
searchAndTrigger(preconf);
}
}
if(data.config_complete) {
buy_btn.removeAttr('disabled');
} else {
buy_btn.attr('disabled', 'disabled');
}
if(productnumber == "TESTHEMD37001") {
$("#dpp_link").html('Link: <a target="_blank" href="'+ data.dpp + '">Zum Produktpass</a>');
}
//if (data.variant_product_productnumber != null) {
// $("#xconfigProductNumber").html(data.variant_product_productnumber;
//}
//if (data.variant_product_ean != null) {
// $("#xconfigEan").html(data.variant_product_ean;
//}
var buy_form = $("#productDetailPageBuyProductForm");
buy_form.attr("action", "/checkout/xconfig-line-item/add");
if (productnumber != "parking3000") {
if (data.variant_product_price1.raw != null) {
main_price = data.variant_product_price1.raw;
if (currency == "CHF") {
$(".product-detail-price").html(data.variant_product_price1_chf.formatted);
$("#x-main-article-price").html(data.variant_product_price1_chf.formatted);
$(".product-detail-price-brutto").html("<span class='brutto-price-number'>" + data.variant_product_price1_brutto_chf.formatted + "</span><br>inkl. MwSt.");
} else {
$(".product-detail-price").html(data.variant_product_price1.formatted);
$("#x-main-article-price").html(data.variant_product_price1.formatted);
$(".product-detail-price-brutto").html("<span class='brutto-price-number'>" + data.variant_product_price1_brutto.formatted + "</span><br>inkl. MwSt.");
}
calcprice();
}
}
$(".xconfig_description").html(data.config_product_description);
// if (data.variant_product_media != "") {
// var gallery_image = $(".gallery-slider-image").first();
// $('#xconfigMedia').val(data.variant_product_media[0].media_path);
// gallery_image.attr("src", data.variant_product_media[0].media_path.replace(/ /g, '%20'));
// 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");
// gallery_image.attr("data-full-image", data.variant_product_media[0].media_path.replace(/ /g, '%20'));
// $( ".product-media-append" ).hide();
// } else {
//if(data.config_complete) {
// $( ".product-media-append" ).show();
//} else {
// $( ".product-media-append" ).hide();
//}
// }
if (productnumber == "SchrankeS" || productnumber == "parking" || productnumber == "industrial" ||
productnumber == "koloss" || productnumber == "solar" || productnumber == "parking3000") {
} else {
var item_pdf = "";
if (data.variant_product_media != "") {
data.variant_product_media.forEach(function(item){
if(item.media_path.includes('pdf')) {
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 />';
}
});
$("#pdf-media").html(item_pdf);
}
if (item_pdf == "") {
$("#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.');
}
}
if(data.variant_product_start_config.values != "" && data.variant_product_start_config.options != "") {
$("#xStartGroupValues").val(data.variant_product_start_config.values);
$("#xStartGroupIds").val(data.variant_product_start_config.options);
$("#xconfig_start_description").html(data.variant_product_start_config_description);
$('#xconfigStartDesc').val(data.variant_product_start_config_description);
$('#startCartBtn').removeAttr('disabled');
$("#xGroupIds").val(data.variant_product_start_config.values);
$("#xGroupValues").val(data.variant_product_start_config.options);
$('#xconfigDesc').val(data.variant_product_start_config_description);
buy_btn.removeAttr('disabled');
} else {
$('#startCartBtn').attr('disabled', 'disabled');
$('.xconfig_start_block').hide();
}
if (main_tpl == "") {
$('#startCartBtn').hide();
$('.xconfig_start_block').hide();
}
//$(".accessory-hidden-input-id").each(function(e){
// this.value = data.variant_id + $(this).attr("originalid");
//});
$('.x-accessory-item-container').hide();
$('.x-accessories-headline').hide();
// if (data.product_accessories != "") {
// //$('.x-accessory-item-container').hide();
// data.product_accessories.forEach(function(item){
// var product_number = item.product.base.product_number;
// product_number = product_number.replace(".", "_")
// $('#accessory_'+product_number).show();
// $('.x-accessories-headline').show();
// });
// }
if (data.variant_product_accessories != "") {
//$('.x-accessory-item-container').hide();
data.variant_product_accessories.forEach(function(item){
var product_number = item.product.base.product_number;
product_number = product_number.replace(".", "_")
$('#accessory_'+product_number).show();
$('.x-accessories-headline').show();
});
}
// if (data.variant_product_accessories == "" || data.product_accessories == "") {
// $('.x-accessories-headline').hide();
// $('.x-accessory-item-container').hide();
// }
$("#xVariantId").val(data.variant_id);
$(".accessory-variant-id").val(data.variant_id);
if (productnumber == "SchrankeS" || productnumber == "parking" || productnumber == "industrial" ||
productnumber == "koloss" || productnumber == "solar") {
$(".product--headline").html("Konfigurieren Sie jetzt Ihre Anfrage:");
}
if (productnumber == "parking3000") {
$(".product--headline").html("Konfigurieren Sie jetzt Ihren Anfrage:");
buy_btn.removeAttr('disabled');
}
var steps = value_ids.filter(obj => obj != "").length;
if (steps != 0) {
gtag('event', 'Konfigurator: '+productnumber, {'event_category': 'configuration','event_label': 'Schritt:'+steps,'value': true});
//gtag('event', 'Konfigurator: '+productnumber, {
// 'SCHRITT': steps
//});
}
}
});
}
function submitXData() {
$("#xconfig_body :input[name^='group']").each(function(e){
if(this.type == "hidden" || this.type == "text")
{
string = this.name;
string = string.substring(string.lastIndexOf("[")+1,string.lastIndexOf("]"));
groupIds[num] = string;
groupValues[num] = this.value;
num++;
}
});
$("#xGroupIds").val(groupIds);
$("#xGroupValues").val(groupValues);
getConfiguration(0, productnumber, groupIds, groupValues);
groupIds = [];
groupValues = [];
num = 0;
return false;
}
function getSearchParams(k){
var p={};
location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(s,k,v){p[k]=v})
return k?p[k]:p;
}
function submitRestart() {
var groupIds = new Array();
var groupValues = new Array();
config_count = 0;
getConfiguration(0, productnumber, groupIds, groupValues);
$('#startCartBtn').removeAttr('disabled');
$('.xconfig_start_block').show();
$(".product-detail-price").html(original_price);
$("#x-main-article-price").html(original_price);
$(".product-detail-price-brutto").html(brutto_price);
}
function calcprice() {
var main_qty = $( ".custom-select option:selected" ).text();
var fullprice = main_qty * main_price;
$('.x-accessory-item').each(function() {
if($( this ).hasClass("active")) {
accessory_price = $( this ).attr("data-price");
accessory_qty = $( this ).attr("data-qty");
full_accessory = accessory_price * accessory_qty;
fullprice = fullprice + full_accessory;
}
});
if (currency == "CHF") {
fullprice_brutto = fullprice * 1.077;
fullprice_brutto = formatPrice(fullprice_brutto, "CHF")
fullprice = formatPrice(fullprice, "CHF*")
} else {
fullprice_brutto = fullprice * 1.19;
fullprice_brutto = formatPrice(fullprice_brutto, "€")
fullprice = formatPrice(fullprice, "€*")
}
$(".x-full-price").html(fullprice);
$(".x-full-price-brutto").html(fullprice_brutto);
}
function formatPrice(num, currency) {
var p = Number(num).toFixed(2).split(".");
return p[0].split("").reverse().reduce(function(acc, num, i, orig)
{
return num + (i && !(i % 3) ? "." : "") + acc;
} , "") + "," + p[1] + " "+ currency;
}
// Function to search for the option and trigger onchange if found
function searchAndTrigger(preconf) {
var selectElements = document.querySelectorAll('.config_select'); // Select by class name
var searchterm;
if (preconf == "of") {
searchTerm = 'ortsfest';
}
if (preconf == "hn") {
searchTerm = 'herausnehmbar';
}
if (preconf == "ul") {
searchTerm = 'umlegbar';
}
var triggered = false;
selectElements.forEach(function (selectElement) {
if (triggered) {
return;
}
// Enable the select field temporarily
selectElement.disabled = false;
for (var i = 0; i < selectElement.options.length; i++) {
var option = selectElement.options[i];
if (option.innerHTML.toLowerCase().includes(searchTerm)) {
// Option found, trigger onchange
selectElement.value = option.value;
xSend(selectElement); // Pass the select element as a parameter
triggered = true; // Set the flag to true
break;
}
}
});
}
$("#x_info_click").click(function () {
$('#x_info_modal').addClass("show");
});
$(".x-modal-dialog .x-dialog-close").click(function(){
$(this).closest(".x-modal-dialog").removeClass("show");
});
</script>
{% endblock %}
{% block page_product_detail_delivery_informations %}
{% endblock %}
{% block page_product_detail_tax %}
{% endblock %}
{% block page_product_detail_ordernumber_container %}
{% for shop_detail in page.extensions.xconfig.product.data.shop_details %}
{% if shop_detail.type_id == "2" %}
<button class="xaccordion">{{ shop_detail.item_name }}</button>
<div class="xpanel">
<p>{{ shop_detail.item_value|raw }}</p>
</div>
{% endif %}
{% endfor %}
<script>
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>';
$( ".xaccordion" ).click(function() {
this.classList.toggle("xactive");
var panel = this.nextElementSibling;
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
});
$('.cms-element-').css({
position: 'sticky',
top: '140px'
});
$( ".gallery-slider-image" ).click(function() {
$('.cms-element-').css({
position: 'relative'
});
});
$( ".modal-close" ).click(function() {
$('.cms-element-').css({
position: 'sticky'
});
});
$( ".custom-select" ).change(function() {
$('#x-main-article-qty').html(this.value);
$('#main_article_quantity_form').val(this.value);
calcprice();
});
// $( ".x-accessory-item-select" ).change(function() {
// var parent = $( this ).parents(".x-accessory-item");
// parent.attr("data-qty", this.value)
// $( "#x-acc-article-qty-"+ parent.attr("data-id") ).html(this.value);
// calcprice();
// });
// $(".x-accessory-item-input").click(function() {
// var parent = $( this ).parents(".x-accessory-item");
// acc_qty = parent.attr("data-qty");
// acc_price = parent.attr("data-price");
// acc_price = formatPrice(acc_price, "€*");
// acc_name = parent.attr("data-name");
// acc_id = parent.attr("data-id");
// if(!parent.hasClass("active")) {
// parent.addClass("active");
// parent.find(".accessory-hidden-input").each(function() {
// $( this ).removeAttr("disabled");
// });
// $('.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>');
// } else {
// parent.removeClass("active");
// parent.find(".accessory-hidden-input").each(function() {
// $( this ).attr("disabled", true);
// });
// $( "#x-acc-article-"+ acc_id ).remove();
// }
// calcprice();
// });
function article_delete(acc_id) {
$("#acc_input_"+ acc_id ).click();
}
$( "#show-more-accessory" ).click(function() {
$( '.x-accessories-rest' ).show( "slow" );
$( '#show-more-accessory' ).hide();
});
$( "#show-less-accessory" ).click(function() {
$( '.x-accessories-rest' ).hide( "slow" );
$( '#show-more-accessory' ).show();
$('html, body').animate({
scrollTop: parseInt($('.x-accessories-headline').offset().top)
}, 500);
});
function accessoryCheck() {
let total = document.querySelectorAll('.x-accessory-item-input:checked').length;
document.getElementById("totalaccessory").innerHTML = "ausgewählte Zubehörartikel: " + total;
}
</script>
{% endblock %}