From a9cc04dc35d9b56936949177f138a58ab038a277 Mon Sep 17 00:00:00 2001 From: Narek Zakarian Date: Wed, 26 Mar 2025 17:27:21 +0400 Subject: [PATCH] Show other payment methods if isn't eligible for WooPayments If the current store is not eligible for WooPayments, we have to also show the other payment methods. --- modules/ppcp-settings/src/Data/GeneralSettings.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/ppcp-settings/src/Data/GeneralSettings.php b/modules/ppcp-settings/src/Data/GeneralSettings.php index 7cbb7555b..7f3031ca0 100644 --- a/modules/ppcp-settings/src/Data/GeneralSettings.php +++ b/modules/ppcp-settings/src/Data/GeneralSettings.php @@ -9,6 +9,7 @@ declare( strict_types = 1 ); namespace WooCommerce\PayPalCommerce\Settings\Data; +use Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions\DefaultPaymentGateways; use RuntimeException; use WooCommerce\PayPalCommerce\Settings\DTO\MerchantConnectionDTO; use WooCommerce\PayPalCommerce\Settings\Enum\SellerTypeEnum; @@ -306,6 +307,13 @@ class GeneralSettings extends AbstractDataModel { * @return bool */ public function own_brand_only() : bool { + /** + * If the current store is not eligible for WooPayments, we have to also show the other payment methods. + */ + if ( ! in_array( $this->woo_settings['country'], DefaultPaymentGateways::get_wcpay_countries(), true ) ) { + return false; + } + // Temporary dev/test mode. $simulate_cookie = sanitize_key( wp_unslash( $_COOKIE['simulate-branded-only'] ?? '' ) );