Merge pull request #2662 from woocommerce/PCP-3740-fastlane-update-fastlane-block-checkout-description-in-editor

Axo: Remove Axo from the Checkout block in the editor and add an ACDC card preview (3740)
This commit is contained in:
Emili Castells 2024-10-07 10:40:32 +02:00 committed by GitHub
commit 8f13457181
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -102,7 +102,14 @@ class AxoBlockModule implements ServiceModule, ExtendingModule, ExecutableModule
add_action(
'woocommerce_blocks_payment_method_type_registration',
function( PaymentMethodRegistry $payment_method_registry ) use ( $c ): void {
$payment_method_registry->register( $c->get( 'axoblock.method' ) );
/*
* Only register the method if we are not in the admin
* (to avoid two Debit & Credit Cards gateways in the
* checkout block in the editor: one from ACDC one from Axo).
*/
if ( ! is_admin() ) {
$payment_method_registry->register( $c->get( 'axoblock.method' ) );
}
}
);