From c1c8c44af1535f88d01502f1823fd309752573d5 Mon Sep 17 00:00:00 2001 From: Daniel Dudzic Date: Thu, 19 Sep 2024 00:39:53 +0200 Subject: [PATCH] Remove ACDC from the block checkout if Axo is present --- modules/ppcp-blocks/src/BlocksModule.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-blocks/src/BlocksModule.php b/modules/ppcp-blocks/src/BlocksModule.php index d8363e415..61a0fd242 100644 --- a/modules/ppcp-blocks/src/BlocksModule.php +++ b/modules/ppcp-blocks/src/BlocksModule.php @@ -68,7 +68,11 @@ function () { 'woocommerce_blocks_payment_method_type_registration', function( PaymentMethodRegistry $payment_method_registry ) use ( $c ): void { $payment_method_registry->register( $c->get( 'blocks.method' ) ); - $payment_method_registry->register( $c->get( 'blocks.advanced-card-method' ) ); + + // Include ACDC in the Block Checkout only in case Axo doesn't exist or is not available. + if ( !$c->has('axoblock.available' ) || !$c->get( 'axoblock.available' ) ) { + $payment_method_registry->register( $c->get( 'blocks.advanced-card-method' ) ); + } } );