It will be necessary to implement several functionalities to mount this system. And the beginning is exactly "linking user accounts".
Clients and representatives will have a separate role ( role ) , this can be managed manually via code or by using a specialized plugin . I'll show you here how to do this on the Users Profile page. The customer can choose his representative, and the representative can see which clients are associated with him. The logic of this may be different and the interface can be implemented in the frontend along with WooCommerce forms, but the functions to query / save user data will be the same (see Codex for definitions) p>
-
get_users()
-
get_user_meta()
-
update_user_meta()
-
current_user_can()
-
current_user_has_role()
- this is a custom function created by me from references
In this example, I use the default roles, Subscriber equivalent to Client
04.11.2014 / 14:59