Do not save customer id in meta if vault v3 enabled

This commit is contained in:
Emili Castells Guasch 2024-01-16 09:26:00 +01:00
parent dd6293cf94
commit 6174ace832

View file

@ -54,7 +54,11 @@ class VaultingModule implements ModuleInterface {
$subscription_helper = $container->get( 'wc-subscriptions.helper' );
add_action(
'woocommerce_created_customer',
function( int $customer_id ) use ( $subscription_helper ) {
function( int $customer_id ) use ( $subscription_helper, $container ) {
if ( $container->has( 'save-payment-methods.eligible' ) && $container->get( 'save-payment-methods.eligible' ) ) {
return;
}
$session = WC()->session;
if ( ! $session ) {
return;