subaccount user id

d3m0n

Member
Hello ,

hope every one is well and safe
i am working on a sub account extension and i am trying to get sub account user id. Whenever I am logged in with the sub account user detail. I get the parent user log in detail ID. how can i get sub account user id ,when u login in with sub account ?

i don't see any hooks and filters for subaccounts

any advices are welcome
 
This might help:
PHP:
$customerId = (int)customer()->getId(); // parent
if (is_subaccount()) {
    /** @var Customer $customer */
    $customer = subaccount()->customer();
    $customerId = (int)$customer->customer_id; // sub-account
}
 
Back
Top