From 7d2dd722bd211340b32ca85f5113fb49a7b48166 Mon Sep 17 00:00:00 2001 From: Martin Gross Date: Wed, 9 Nov 2022 15:04:35 +0100 Subject: [PATCH] PayPal: Fix loading of Smart Payment Buttons on APM payment page (regression introduced in #2875) --- .../static/pretixplugins/paypal2/pretix-paypal.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pretix/plugins/paypal2/static/pretixplugins/paypal2/pretix-paypal.js b/src/pretix/plugins/paypal2/static/pretixplugins/paypal2/pretix-paypal.js index db8d7e892..4fbbb5c07 100644 --- a/src/pretix/plugins/paypal2/static/pretixplugins/paypal2/pretix-paypal.js +++ b/src/pretix/plugins/paypal2/static/pretixplugins/paypal2/pretix-paypal.js @@ -72,9 +72,13 @@ var pretixpaypal = { pretixpaypal.currency = $("body").attr("data-currency"); pretixpaypal.locale = this.guessLocale(); } - // if no payment option is selected, disable the continue button - if (!pretixpaypal.continue_button[0].form.elements['payment'].value) { - pretixpaypal.continue_button.prop("disabled", true); + + // If no payment option is selected, and we're not on the paypage (which doesn't have a continue button), + // disable the continue button + if (!pretixpaypal.paypage) { + if (!pretixpaypal.continue_button[0].form.elements['payment'].value) { + pretixpaypal.continue_button.prop("disabled", true); + } } // We are setting the cogwheel already here, as the renderAPM() method might take some time to get loaded.