Besplatna dostava od 12000RSD

Da li imaš pitanje za nas?

Naš tim je tu da pomogne.

This site is protected by hCaptcha and the hCaptcha Privacy Policy and Terms of Service apply.

`); newTab.document.close(); } else { window.location.href = finalUrl; } } // ✅ Pour le bouton Checkout dans le panier function handleCartCheckout(button) { if (button.classList.contains('redirect-active')) return; button.classList.add('redirect-active'); button.addEventListener("click", function(event) { event.preventDefault(); fetch('/cart.js') .then(res => res.json()) .then(cart => { redirectToSanovita(cart.items); }) .catch(error => { console.error("Erreur récupération panier :", error); }); }); } // ✅ Pour le bouton Buy it now sur une fiche produit function handleBuyNow(button) { if (button.classList.contains('redirect-active')) return; button.classList.add('redirect-active'); button.addEventListener("click", function(event) { event.preventDefault(); const form = button.closest('form'); const formData = new FormData(form); fetch('/cart/add.js', { method: 'POST', body: formData, headers: { 'Accept': 'application/json' } }) .then(() => fetch('/cart.js')) .then(res => res.json()) .then(cart => { redirectToSanovita(cart.items); }) .catch(error => { console.error("Erreur Buy Now :", error); }); }); } // ✅ Observation dynamique des boutons const observer = new MutationObserver(() => { const checkoutButton = document.querySelector('button[name="checkout"]'); const buyNowButton = document.querySelector('button[name="buy_now"]'); if (checkoutButton) handleCartCheckout(checkoutButton); if (buyNowButton) handleBuyNow(buyNowButton); }); observer.observe(document.body, { childList: true, subtree: true }); });