diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js index d5df1460d..9519f9073 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js @@ -10,6 +10,10 @@ class CheckoutBootstap { this.spinner = spinner; this.standardOrderButtonSelector = '#place_order'; + + this.buttonChangeObserver = new MutationObserver((el) => { + this.updateUi(); + }); } init() { @@ -64,6 +68,11 @@ class CheckoutBootstap { this.gateway.hosted_fields.wrapper, actionHandler.configuration(), ); + + this.buttonChangeObserver.observe( + document.querySelector(this.standardOrderButtonSelector), + {attributes: true} + ); } updateUi() {