check if axo is enabled or not for buttons

This commit is contained in:
Daniel Hüsken 2024-12-12 16:03:32 +01:00
parent d5f0ada0ce
commit 947f20a2a5
No known key found for this signature in database
GPG key ID: 9F732DA37FA709E8
3 changed files with 11 additions and 3 deletions

View file

@ -92,7 +92,10 @@ class AxoBlockModule implements ServiceModule, ExtendingModule, ExecutableModule
*/
add_filter(
'woocommerce_paypal_payments_sdk_components_hook',
function( $components ) {
function( $components ) use ( $c ) {
if ( ! $c->has( 'axo.available' ) || ! $c->get( 'axo.available' ) ) {
return $components;
}
$components[] = 'fastlane';
return $components;
}