diff --git a/view/frontend/web/js/view/cart/subscription.js b/view/frontend/web/js/view/cart/subscription.js index 7247b49..3b92e16 100755 --- a/view/frontend/web/js/view/cart/subscription.js +++ b/view/frontend/web/js/view/cart/subscription.js @@ -34,15 +34,18 @@ define( } var self = this; - function callback() { - self.initInstantPurchaseConfig(); - observer.disconnect(); + + if ($('#instant-purchase').length ) { + function callback() { + self.initInstantPurchaseConfig(); + observer.disconnect(); + } + const observer = new MutationObserver(callback); + observer.observe( + document.getElementById('instant-purchase'), + { attributes: true, childList: true, subtree: true, characterData: true} + ); } - const observer = new MutationObserver(callback); - observer.observe( - document.getElementById('instant-purchase'), - { attributes: true, childList: true, subtree: true, characterData: true} - ); }, initObservable: function () {