Use guest customer id when loading script if it exist

This commit is contained in:
dinamiko 2022-01-04 14:53:52 +01:00
parent 2108b35a21
commit 5786ae6bbd

View file

@ -103,6 +103,11 @@ class IdentityToken {
WC()->session->set( 'ppcp_guest_customer_id', $customer_id );
}
$guest_customer_id = get_user_meta( $customer_id, 'ppcp_guest_customer_id', true );
if ( $guest_customer_id ) {
$customer_id = $guest_customer_id;
}
$args['body'] = wp_json_encode( array( 'customer_id' => $this->prefix . (string) $customer_id ) );
}