In PHP, is it possible to grab the customer model from a user model?
EDIT: I just noticed that it is possible to attach a customer info field to the user. How do we achieve this?
You shouldn't really need to do that, you're just adding custom fields to the user when those can be fetched easilly. A customer will always be a user, but a user might not be a customer.
If you intend to get the customer details from a plugin (with PHP) you can just get the customer details (if exist) from the user, by using the Commerce_CustomersService
code example would be
$customer = craft()->commerce_customers->getCustomerByUserId($user->id);
this will either return the customer model or null (if a customer is not created against the user).
Figured it out. For anyone else looking for this info, the answer is:
Create a field of type Customer Customer Info. Add it as a field in the User Field Settings.
Access it using the handle you assigned it.
E.g.
$customer = $user->customerInfo;