mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Merge pull request #423 from woocommerce/PCP-434-allow-guest-users-to-purchase-su
Add customer id for guest users purchasing subscriptions
This commit is contained in:
commit
0fee10931a
13 changed files with 183 additions and 89 deletions
|
@ -98,6 +98,17 @@ class VaultingModule implements ModuleInterface {
|
|||
}
|
||||
);
|
||||
|
||||
$subscription_helper = $container->get( 'subscription.helper' );
|
||||
add_action(
|
||||
'woocommerce_created_customer',
|
||||
function( int $customer_id ) use ( $subscription_helper ) {
|
||||
$guest_customer_id = WC()->session->get( 'ppcp_guest_customer_id' );
|
||||
if ( $guest_customer_id && $subscription_helper->cart_contains_subscription() ) {
|
||||
update_user_meta( $customer_id, 'ppcp_guest_customer_id', $guest_customer_id );
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$asset_loader = $container->get( 'vaulting.assets.myaccount-payments' );
|
||||
add_action(
|
||||
'wp_enqueue_scripts',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue