mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
🎨 Make condition easier to read
This commit is contained in:
parent
80a99c75d3
commit
1938f6b6ed
1 changed files with 5 additions and 3 deletions
|
@ -58,11 +58,13 @@ class DisabledFundingSources {
|
|||
? $this->settings->get( 'disable_funding' )
|
||||
: array();
|
||||
|
||||
$is_dcc_enabled = $this->settings->has( 'dcc_enabled' ) && $this->settings->get( 'dcc_enabled' );
|
||||
$is_dcc_enabled = $this->settings->has( 'dcc_enabled' ) && $this->settings->get( 'dcc_enabled' );
|
||||
$is_checkout = is_checkout();
|
||||
$is_block_context = in_array( $context, array( 'checkout-block', 'cart-block' ), true );
|
||||
|
||||
if (
|
||||
! is_checkout()
|
||||
|| ( $is_dcc_enabled && in_array( $context, array( 'checkout-block', 'cart-block' ), true ) )
|
||||
! $is_checkout
|
||||
|| ( $is_dcc_enabled && $is_block_context )
|
||||
) {
|
||||
$disable_funding[] = 'card';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue