- Levering: 1-3 werkdagen
- Gratis retour
- 10% korting via aankoopbon
- Gratis verzending vanaf 35€
function initializeProduct() { var stockCheckBtn = document.querySelector(‘.js-stock-check’); var stockCheckModal = document.querySelector(‘.js-stock-check-modal’); var stockCheckModalContent = stockCheckModal.querySelector(‘.js-stock-check-modal-content’); var stockCheckModalCloseBtn = stockCheckModal.querySelector(‘.js-stock-check-modal-close’); var variantPickerWrapper = document.querySelector(‘.js-variant-picker’); var variantSku = document.querySelector(‘.variant-sku’).dataset.sku; if (variantSku) { const variantSkuParts = variantSku.split(“_”); const sku = variantSkuParts[0]; const variant = variantSkuParts[1]; fetchStockFromAvelon(sku, variant, stockCheckModalContent); } stockCheckBtn.addEventListener(‘click’, function() { stockCheckModal.classList.add(‘js-open’); }); stockCheckModalCloseBtn.addEventListener(‘click’, function() { stockCheckModal.classList.remove(‘js-open’); }); variantPickerWrapper.querySelectorAll(‘.block-swatch’).forEach((swatch) => { swatch.addEventListener(‘click’, function() { stockCheckModalContent.innerHTML = “”; setTimeout(() => { variantSku = document.querySelector(‘.variant-sku’).dataset.skuUpdate; const variantSkuParts = variantSku.split(“_”); const sku = variantSkuParts[0]; const variant = variantSkuParts[1]; fetchStockFromAvelon(sku, variant, stockCheckModalContent); }, 500); }); }); // Close search nav when clicking on page. document.addEventListener(‘click’, (ev) => { if (ev.target.closest(‘.js-stock-check-modal’) === null && ev.target.closest(‘.js-stock-check’) === null) { stockCheckModal.classList.remove(‘js-open’); } }); } function fetchStockFromAvelon(sku, variant, stockCheckModalContent) { var stockMessages = [] // Push each discount into the this.discounts array const requestOptions = { method: “GET”, redirect: “follow” }; fetch(`https://bent-schoenen.nextsite.dev/api/stock-check/${sku}/${variant}`, requestOptions) .then((response) => response.text()) .then((result) => { result = JSON.parse(result); // Loop over the data for (const key in result) { if (result.hasOwnProperty(key)) { const item = result[key]; let messageClass = ‘error’; let message = ”; if (item.Stock === 0) { messageClass = ‘error’; message = ‘Niet op voorraad’; } else if (item.Stock > 0 && item.Stock <= 3) { messageClass = 'warning'; message = 'Gelimiteerd op voorraad' } else { messageClass = 'success'; message = 'Op voorraad'; } // Skip items with id 0 and 70 (is webshop and magazijn) if (item.Id !== 0 && item.Id !== 70) { // Process the item const div = document.createElement('div'); div.className = 'stock-check__shop'; // Add content to the div div.innerHTML = `
BENT Merkschoenen ${item.Name}
`; // Append the new div to the container stockCheckModalContent.appendChild(div); } } } }) .catch((error) => console.error(error)); } window.onload = initializeProduct;
- Type: Slippers
- Kleur: Goud , Kaki
- Hakhoogte: Plat
- Materialen: Kunststof
- Type: Slippers
- Kleur: Goud , Kaki
- Hakhoogte: Plat
- Materialen: Kunststof
Size | 36, 37, 38, 39, 40, 41, 42, 37.5, 38.5, 40.5 |
---|
Be the first to review “Gouden slippers” Reactie annuleren
Related products
Dames
Ballerina's
Dames
Dames
Dames
Ballerina's
Dames
Ballerina's
Dames
Dames
Dames
Ballerina's
Dames
Ballerina's
Ballerina's
Dames
Reviews
There are no reviews yet.