// -- Script to hide all attribute values that are not available based on the already selected attributes let interval = setInterval(() => { if (!window.vueApp) return; clearInterval(interval); window.vueApp.$store.subscribe((mutation, state) => { let type = mutation.type.split("/").pop(); if (type != "selectItemAttribute") return console.log("type: " + mutation.type); let options = document.querySelectorAll("option"); // Hide all "Keine Auswahl" options Array.from(options).forEach((option) => { if (!option.value) option.style.display = "none"; }); if (!mutation.payload) return; if (mutation.payload.isFromSubscriber) return; let itemId = mutation.type.split("/").shift(); let firstSelect = document.querySelector(".variation-select select"); // Show all options Array.from(options).forEach((option) => (option.style.display = "block")); requestAnimationFrame(() => { if (!state.items[itemId]) return; let selectedAttributeValues = Object.values(state.items[itemId].variationSelect.selectedAttributes).filter((value) => value != -1); let variations = state.items[itemId].variationSelect.variations; let allAttributes = variations.map((variation) => variation.attributes).flat(); // Find variations where some variation.attributes has attributeId == attributeId let variationsWithAttribute = variations.filter((variation) => { return selectedAttributeValues.every((selectedAttributeValue) => { return variation.attributes.find((attribute) => { return attribute.attributeValueId == selectedAttributeValue; }); }); }); let attributeValueIds = variationsWithAttribute .map((variation) => variation.attributes.map((attribute) => attribute.attributeValueId)) .flat(); let attributeIds = variations.map((variation) => variation.attributes.map((attribute) => attribute.attributeId)).flat(); // Find options where option.value is not attributeValueIds, meaning there is no variation with that attributeValueId let optionsToDisable = Array.from(options).filter((option) => !attributeValueIds.includes(Number(option.value))); // Disable options optionsToDisable.forEach((option) => { console.log("Parentvalue", option.parentElement.value, option.value, !!option.value); if (option.parentElement == firstSelect || option.parentElement.value != "-1") return; option.style.display = "none"; }); let selects = document.querySelectorAll(".variation-select select"); // if there is only one option left, select it requestAnimationFrame(() => { // Otherwise, check if there is only one option left for each select, if so, select it Array.from(selects).forEach((select) => { let visibleOptions = Array.from(select.options).filter((option) => option.style.display != "none"); if (visibleOptions.length == 1) { let attributeValueId = Number(visibleOptions[0].value); let attributeId = allAttributes.find((attribute) => attribute.attributeValueId == attributeValueId).attributeId; window.vueApp.$store.commit(itemId + "/variationSelect/selectItemAttribute", { attributeValueId, attributeId, isFromSubscriber: true, }); } }); // Wait for 0.5 seconds, then check each select to see if all options are hidden, if so, there was an attribute mismatch and we need to reset the selection setTimeout(() => { Array.from(selects).forEach((select) => { let visibleOptions = Array.from(select.options).filter((option) => option.style.display != "none"); if (visibleOptions.length > 0) return; Array.from(options).forEach((option) => { if (!option.value) return; option.style.display = "block"; }); // Reset selection attributeIds.forEach((attributeId) => { window.vueApp.$store.commit(itemId + "/variationSelect/selectItemAttribute", { attributeValueId: -1, attributeId, isFromSubscriber: true, }); }); }); // Check if all selects have a value selected that is not -1 let allSelectsHaveValue = Array.from(selects).every((select) => select.value != -1); if (allSelectsHaveValue) { // Make sure to load the variation let variation = variations.find((variation) => { return selectedAttributeValues.every((selectedAttributeValue) => { return variation.attributes.find((attribute) => { return attribute.attributeValueId == selectedAttributeValue; }); }); }); if (variation) { window.vueApp.$store.dispatch(itemId + "/loadVariation", variation.variationId); } } }, 500); }); }); }); }, 330);

Reststück

Artikelnummer: XHGW-10-4000523326

Nicht in Kategorie 184
if(!document.getElementById('paypal-smart-payment-script')) { var script = document.createElement("script"); script.type = "module"; script.id = "paypal-smart-payment-script"; script.src = "https://cdn02.plentymarkets.com/2x0z7ibnauvk/plugin/8/paypal/js/smartPaymentScript.min.js"; script.setAttribute("data-client-id", "AfnkVAZrCjSo2SQ9gCjBEghzwv8l19ENAe-RuNacloe77tQZlOkM4bmIopxO_Q04Ji9cVl22rYUT1ggk"); script.setAttribute("data-currency", "EUR"); script.setAttribute("data-client-token", "eyJicmFpbnRyZWUiOnsiYXV0aG9yaXphdGlvbkZpbmdlcnByaW50IjoiZGE1ZGM2MDIzMzgyYjc1NmMzMGVlODJmZTVhMjNiNWE3YjJiOTFhNGVlMDlkMTgzOGQwYjhmMDU5MmIyODQ0YnxtZXJjaGFudF9pZD1yd3dua3FnMnhnNTZobTJuJnB1YmxpY19rZXk9ajJmYzJqcHhkZzZ2cDg0ZiZjcmVhdGVkX2F0PTIwMjQtMTEtMjRUMTA6MjE6MjkuMzE0WiIsInZlcnNpb24iOiIzLXBheXBhbCJ9LCJwYXlwYWwiOnsiaWRUb2tlbiI6bnVsbCwiYWNjZXNzVG9rZW4iOiJBMjFBQU1KcnBBYXJtTThSMWh2SXZsczhQaUhyQjJNTHBfMnRhc2IyN21GSVhidS1NVUhRM0xwTENuZnUwdk1pdDZnRjB2bXNHUUlWT2Z0TWtzVUoxZ3ZCSUNrTVgwT2dRIn19"); script.setAttribute("data-append-trailing-slash", "true"); script.setAttribute("data-locale", "de_DE"); document.body.appendChild(script); } else { var script = document.getElementById('paypal-smart-payment-script'); script.setAttribute("data-client-id", "AfnkVAZrCjSo2SQ9gCjBEghzwv8l19ENAe-RuNacloe77tQZlOkM4bmIopxO_Q04Ji9cVl22rYUT1ggk"); script.setAttribute("data-currency", "EUR"); script.setAttribute("data-client-token", "eyJicmFpbnRyZWUiOnsiYXV0aG9yaXphdGlvbkZpbmdlcnByaW50IjoiZGE1ZGM2MDIzMzgyYjc1NmMzMGVlODJmZTVhMjNiNWE3YjJiOTFhNGVlMDlkMTgzOGQwYjhmMDU5MmIyODQ0YnxtZXJjaGFudF9pZD1yd3dua3FnMnhnNTZobTJuJnB1YmxpY19rZXk9ajJmYzJqcHhkZzZ2cDg0ZiZjcmVhdGVkX2F0PTIwMjQtMTEtMjRUMTA6MjE6MjkuMzE0WiIsInZlcnNpb24iOiIzLXBheXBhbCJ9LCJwYXlwYWwiOnsiaWRUb2tlbiI6bnVsbCwiYWNjZXNzVG9rZW4iOiJBMjFBQU1KcnBBYXJtTThSMWh2SXZsczhQaUhyQjJNTHBfMnRhc2IyN21GSVhidS1NVUhRM0xwTENuZnUwdk1pdDZnRjB2bXNHUUlWT2Z0TWtzVUoxZ3ZCSUNrTVgwT2dRIn19"); script.setAttribute("data-append-trailing-slash", "true"); script.setAttribute("data-locale", "de_DE"); }
if (typeof paypal_plenty_sdk === 'undefined' || typeof renderPayPalButtons !== 'function') { document.addEventListener('payPalScriptInitialized', () => { renderPayPalButtons('67430122c24a5', 'paylater', 'paypal', 'rect', 'gold'); }); } else { renderPayPalButtons('67430122c24a5', 'paylater', 'paypal', 'rect', 'gold'); } if (typeof paypal_plenty_sdk === 'undefined' || typeof renderPayPalButtons !== 'function') { document.addEventListener('payPalScriptInitialized', () => { renderPayPalButtons('67430122c24a5', 'paypal', 'buynow', 'rect', 'gold'); }); } else { renderPayPalButtons('67430122c24a5', 'paypal', 'buynow', 'rect', 'gold'); }
if(!document.getElementById('paypal-smart-payment-script')) { var script = document.createElement("script"); script.type = "module"; script.id = "paypal-smart-payment-script"; script.src = "https://cdn02.plentymarkets.com/2x0z7ibnauvk/plugin/8/paypal/js/smartPaymentScript.min.js"; script.setAttribute("data-client-id", "AfnkVAZrCjSo2SQ9gCjBEghzwv8l19ENAe-RuNacloe77tQZlOkM4bmIopxO_Q04Ji9cVl22rYUT1ggk"); script.setAttribute("data-currency", "EUR"); script.setAttribute("data-client-token", "eyJicmFpbnRyZWUiOnsiYXV0aG9yaXphdGlvbkZpbmdlcnByaW50IjoiZGE1ZGM2MDIzMzgyYjc1NmMzMGVlODJmZTVhMjNiNWE3YjJiOTFhNGVlMDlkMTgzOGQwYjhmMDU5MmIyODQ0YnxtZXJjaGFudF9pZD1yd3dua3FnMnhnNTZobTJuJnB1YmxpY19rZXk9ajJmYzJqcHhkZzZ2cDg0ZiZjcmVhdGVkX2F0PTIwMjQtMTEtMjRUMTA6MjE6MjkuMzE0WiIsInZlcnNpb24iOiIzLXBheXBhbCJ9LCJwYXlwYWwiOnsiaWRUb2tlbiI6bnVsbCwiYWNjZXNzVG9rZW4iOiJBMjFBQU1KcnBBYXJtTThSMWh2SXZsczhQaUhyQjJNTHBfMnRhc2IyN21GSVhidS1NVUhRM0xwTENuZnUwdk1pdDZnRjB2bXNHUUlWT2Z0TWtzVUoxZ3ZCSUNrTVgwT2dRIn19"); script.setAttribute("data-append-trailing-slash", "true"); script.setAttribute("data-locale", "de_DE"); document.body.appendChild(script); } else { var script = document.getElementById('paypal-smart-payment-script'); script.setAttribute("data-client-id", "AfnkVAZrCjSo2SQ9gCjBEghzwv8l19ENAe-RuNacloe77tQZlOkM4bmIopxO_Q04Ji9cVl22rYUT1ggk"); script.setAttribute("data-currency", "EUR"); script.setAttribute("data-client-token", "eyJicmFpbnRyZWUiOnsiYXV0aG9yaXphdGlvbkZpbmdlcnByaW50IjoiZGE1ZGM2MDIzMzgyYjc1NmMzMGVlODJmZTVhMjNiNWE3YjJiOTFhNGVlMDlkMTgzOGQwYjhmMDU5MmIyODQ0YnxtZXJjaGFudF9pZD1yd3dua3FnMnhnNTZobTJuJnB1YmxpY19rZXk9ajJmYzJqcHhkZzZ2cDg0ZiZjcmVhdGVkX2F0PTIwMjQtMTEtMjRUMTA6MjE6MjkuMzE0WiIsInZlcnNpb24iOiIzLXBheXBhbCJ9LCJwYXlwYWwiOnsiaWRUb2tlbiI6bnVsbCwiYWNjZXNzVG9rZW4iOiJBMjFBQU1KcnBBYXJtTThSMWh2SXZsczhQaUhyQjJNTHBfMnRhc2IyN21GSVhidS1NVUhRM0xwTENuZnUwdk1pdDZnRjB2bXNHUUlWT2Z0TWtzVUoxZ3ZCSUNrTVgwT2dRIn19"); script.setAttribute("data-append-trailing-slash", "true"); script.setAttribute("data-locale", "de_DE"); }

* inkl. ges. MwSt. zzgl. Versandkosten

document.addEventListener("DOMContentLoaded", function () { requestAnimationFrame(function () { requestAnimationFrame(function () { const el = document.querySelector(".bs-technische-daten > div"); const inputString = el.innerText; const ul = document.createElement("ul"); ul.classList.add("bs-technische-daten-liste"); inputString.split("•").forEach((item) => { const li = document.createElement("li"); li.textContent = item.trim(); if (li.textContent.length < 2) return; li.textContent = li.textContent.charAt(0).toUpperCase() + li.textContent.slice(1); li.textContent = "• " + li.textContent; ul.appendChild(li); }); el.innerHTML = ""; el.appendChild(ul); }); }); });

Produkte, die dir auch gefallen könnten