From f0e2ca2b5b59bf4ace8521a423955b4bf92f6500 Mon Sep 17 00:00:00 2001 From: "Alex P." Date: Mon, 23 Sep 2024 09:10:49 +0300 Subject: [PATCH] Remove continuation context --- modules/ppcp-axo/src/AxoModule.php | 2 +- modules/ppcp-button/src/Helper/ContextTrait.php | 4 ---- modules/ppcp-googlepay/resources/js/boot.js | 6 ++++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/ppcp-axo/src/AxoModule.php b/modules/ppcp-axo/src/AxoModule.php index 069860550..e5b2f59e5 100644 --- a/modules/ppcp-axo/src/AxoModule.php +++ b/modules/ppcp-axo/src/AxoModule.php @@ -167,7 +167,7 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule { // Check if the module is applicable, correct country, currency, ... etc. if ( ! $is_paypal_enabled || ! $c->get( 'axo.eligible' ) - || 'continuation' === $c->get( 'button.context' ) + || $this->is_paypal_continuation() || $subscription_helper->cart_contains_subscription() ) { return; diff --git a/modules/ppcp-button/src/Helper/ContextTrait.php b/modules/ppcp-button/src/Helper/ContextTrait.php index 44119d67a..02320c20a 100644 --- a/modules/ppcp-button/src/Helper/ContextTrait.php +++ b/modules/ppcp-button/src/Helper/ContextTrait.php @@ -173,10 +173,6 @@ trait ContextTrait { case $this->is_block_editor(): $context = 'block-editor'; break; - - case $this->is_paypal_continuation(): - $context = 'continuation'; - break; } return apply_filters( 'woocommerce_paypal_payments_context', $context ); diff --git a/modules/ppcp-googlepay/resources/js/boot.js b/modules/ppcp-googlepay/resources/js/boot.js index fb9e8e313..ab0d99582 100644 --- a/modules/ppcp-googlepay/resources/js/boot.js +++ b/modules/ppcp-googlepay/resources/js/boot.js @@ -31,8 +31,10 @@ import moduleStorage from './Helper/GooglePayStorage'; } function bootstrapCheckout() { - if ( context && ! [ 'continuation', 'checkout' ].includes( context ) ) { - // Context must be missing/empty, or "continuation"/"checkout" to proceed. + if ( context + && ! [ 'checkout' ].includes( context ) + && ! (context === 'mini-cart' && ppcpConfig.continuation) ) { + // Context must be missing/empty, or "checkout"/checkout continuation to proceed. return; } if ( ! CheckoutBootstrap.isPageWithCheckoutForm() ) {