mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
🐛 Fix “use-ACDC” flag in legacy UI
A new filter adds backwards compatibility by overwriting the ACDC decision with a settings choice.
This commit is contained in:
parent
09c4f176d0
commit
fb27373c1b
1 changed files with 13 additions and 1 deletions
|
@ -508,6 +508,18 @@ class CompatModule implements ServiceModule, ExtendingModule, ExecutableModule {
|
|||
return;
|
||||
}
|
||||
|
||||
// Add filters here...
|
||||
add_filter(
|
||||
'woocommerce_paypal_payments_is_acdc_active',
|
||||
static function ( bool $is_acdc ) use ( $container ) : bool {
|
||||
$settings = $container->get( 'wcgateway.settings' );
|
||||
assert( $settings instanceof Settings );
|
||||
|
||||
try {
|
||||
return (bool) $settings->get( 'dcc_enabled' );
|
||||
} catch ( NotFoundException $exception ) {
|
||||
return $is_acdc;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue