mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Merge pull request #3566 from woocommerce/PCP-5021-new-ui-google-pay-dependencies-between-locations-for-payment-method-availability
Prevent early `is_enabled()` check for Google Pay button in new UI (5021)
This commit is contained in:
commit
ea1a9a0951
1 changed files with 5 additions and 2 deletions
|
@ -17,6 +17,7 @@ use WooCommerce\PayPalCommerce\Button\Assets\SmartButtonInterface;
|
|||
use WooCommerce\PayPalCommerce\Googlepay\Endpoint\UpdatePaymentDataEndpoint;
|
||||
use WooCommerce\PayPalCommerce\Googlepay\Helper\ApmProductStatus;
|
||||
use WooCommerce\PayPalCommerce\Googlepay\Helper\AvailabilityNotice;
|
||||
use WooCommerce\PayPalCommerce\Settings\SettingsModule;
|
||||
use WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Module\ExecutableModule;
|
||||
use WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Module\ExtendingModule;
|
||||
use WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait;
|
||||
|
@ -149,9 +150,11 @@ class GooglepayModule implements ServiceModule, ExtendingModule, ExecutableModul
|
|||
add_action(
|
||||
'woocommerce_blocks_payment_method_type_registration',
|
||||
function( PaymentMethodRegistry $payment_method_registry ) use ( $c, $button ): void {
|
||||
if ( $button->is_enabled() ) {
|
||||
$payment_method_registry->register( $c->get( 'googlepay.blocks-payment-method' ) );
|
||||
if ( SettingsModule::should_use_the_old_ui() && ! $button->is_enabled() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$payment_method_registry->register( $c->get( 'googlepay.blocks-payment-method' ) );
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue