🐛 Only load BCDC button on Classic Checkout

This commit is contained in:
Daniel Dudzic 2025-05-23 19:55:24 +02:00
parent 57e70683b1
commit 06a8e16a64
No known key found for this signature in database
GPG key ID: 31B40D33E3465483

View file

@ -13,6 +13,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException;
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
use WooCommerce\PayPalCommerce\WcSubscriptions\FreeTrialHandlerTrait;
use WooCommerce\PayPalCommerce\WcGateway\Helper\CardPaymentsConfiguration;
use WooCommerce\PayPalCommerce\WcGateway\Helper\CartCheckoutDetector;
/**
* Class DisabledFundingSources
@ -154,7 +155,7 @@ class DisabledFundingSources {
* @return array
*/
private function apply_context_rules( array $disable_funding ) : array {
if ( 'MX' === $this->merchant_country && $this->dcc_configuration->is_bcdc_enabled() && is_checkout() ) {
if ( 'MX' === $this->merchant_country && $this->dcc_configuration->is_bcdc_enabled() && CartCheckoutDetector::has_classic_checkout() && is_checkout() ) {
return $disable_funding;
}