Remove ACDC from the block checkout if Axo is present

This commit is contained in:
Daniel Dudzic 2024-09-19 00:39:53 +02:00
parent b0c43a02d2
commit c1c8c44af1
No known key found for this signature in database
GPG key ID: 31B40D33E3465483

View file

@ -68,7 +68,11 @@ class BlocksModule implements ServiceModule, ExtendingModule, ExecutableModule {
'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' ) );
}
}
);