Fix GooglePay and ApplePay loading scripts on admin standard payments page.

This commit is contained in:
Pedro Silva 2023-11-13 13:55:08 +00:00
parent ac7779bc41
commit c8d4c12a2d
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
3 changed files with 9 additions and 2 deletions

View file

@ -94,6 +94,7 @@ class GooglepayModule implements ModuleInterface {
assert( $smart_button instanceof SmartButtonInterface );
if ( $smart_button->should_load_ppcp_script() ) {
$button->enqueue();
return;
}
if ( has_block( 'woocommerce/checkout' ) || has_block( 'woocommerce/cart' ) ) {
@ -111,7 +112,7 @@ class GooglepayModule implements ModuleInterface {
add_action(
'admin_enqueue_scripts',
static function () use ( $c, $button ) {
if ( ! is_admin() ) {
if ( ! is_admin() || ! $c->get( 'wcgateway.is-ppcp-settings-standard-payments-page' ) ) {
return;
}