Add my account save payment (WIP)

This commit is contained in:
Emili Castells Guasch 2023-10-23 16:50:43 +02:00
parent b07ac130dc
commit 1d74d08b4f
6 changed files with 77 additions and 3 deletions

View file

@ -191,7 +191,10 @@ class VaultingModule implements ModuleInterface {
'woocommerce_available_payment_gateways',
function( array $methods ): array {
global $wp;
if ( isset( $wp->query_vars['add-payment-method'] ) ) {
if (
isset( $wp->query_vars['add-payment-method'] )
&& apply_filters( 'woocommerce_paypal_payments_disable_add_payment_method', true )
) {
unset( $methods[ PayPalGateway::ID ] );
}