{"id":1478,"date":"2021-01-18T12:18:21","date_gmt":"2021-01-18T11:18:21","guid":{"rendered":"https:\/\/www.einstein-kaffee.de\/warenkorb\/"},"modified":"2024-07-18T15:21:58","modified_gmt":"2024-07-18T13:21:58","slug":"warenkorb","status":"publish","type":"page","link":"https:\/\/einstein-kaffee.de\/en\/warenkorb\/","title":{"rendered":"shopping cart"},"content":{"rendered":"\n\n\n\n<script>\n\/\/ Hide coupon button\ndocument.addEventListener('DOMContentLoaded', function() {\n    function attachEventListeners() {\n        const couponInput = document.getElementById('coupon_code');\n        const applyCouponButton = document.querySelector('input[name=\"apply_coupon\"]');\n\n        applyCouponButton.style.display = 'none';\n\n        couponInput.addEventListener('input', function() {\n            if (couponInput.value.trim() !== \"\") {\n                applyCouponButton.style.display = 'inline-block';\n            } else {\n                applyCouponButton.style.display = 'none';\n            }\n        });\n    }\n\n    attachEventListeners();\n\n    const observer = new MutationObserver((mutations) => {\n        mutations.forEach((mutation) => {\n            if (mutation.type === 'childList' || mutation.type === 'subtree') {\n                attachEventListeners();\n            }\n        });\n    });\n\n    observer.observe(document.body, { childList: true, subtree: true });\n});\n\n\/\/ Hide update cart button\ndocument.addEventListener('DOMContentLoaded', function() {\n    function attachEventListeners() {\n        const plusButtons = document.querySelectorAll('.plus');\n        const minusButtons = document.querySelectorAll('.minus');\n        const updateCartButton = document.querySelector('input[name=\"update_cart\"]');\n\n        function handleButtonClick(event) {\n            setTimeout(() => {\n                if (updateCartButton) {\n                    updateCartButton.disabled = false;\n                    updateCartButton.click();\n                }\n            }, 500);\n        }\n\n        plusButtons.forEach(button => {\n            button.addEventListener('click', function(event) {\n                setTimeout(() => {\n                    handleButtonClick(event);\n                }, 500);\n            });\n        });\n\n        minusButtons.forEach(button => {\n            button.addEventListener('click', function(event) {\n                setTimeout(() => {\n                    handleButtonClick(event);\n                }, 500);\n            });\n        });\n    }\n\n    attachEventListeners();\n\n    const observer = new MutationObserver((mutations) => {\n        mutations.forEach((mutation) => {\n            if (mutation.type === 'childList' || mutation.type === 'subtree') {\n                attachEventListeners();\n            }\n        });\n    });\n\n    observer.observe(document.body, { childList: true, subtree: true });\n});\n<\/script>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1035,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-1478","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/einstein-kaffee.de\/en\/wp-json\/wp\/v2\/pages\/1478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/einstein-kaffee.de\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/einstein-kaffee.de\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/einstein-kaffee.de\/en\/wp-json\/wp\/v2\/users\/1035"}],"replies":[{"embeddable":true,"href":"https:\/\/einstein-kaffee.de\/en\/wp-json\/wp\/v2\/comments?post=1478"}],"version-history":[{"count":0,"href":"https:\/\/einstein-kaffee.de\/en\/wp-json\/wp\/v2\/pages\/1478\/revisions"}],"wp:attachment":[{"href":"https:\/\/einstein-kaffee.de\/en\/wp-json\/wp\/v2\/media?parent=1478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}