This should be fairly simple. Create an observer on the
customer_load_after event. As the method to run, use the following snippet of code (untested) to load the group code from the DB, and then to set it on the newly-loaded customer object.
public function customerLoadAfter($observer)
$customer = $observer->getCustomer();
$resource = $customer->getResource();
$select = $resource->getReadConnection()
->where('entity_id = ?', $customer->getGroupId();
You can then retreive it with
This is probably the most practical way to do this. You could rewrite the customer resource model to
join the data in when loading the model, and while it would be a tad bit more performant, it would definitely take a lot longer/be more complicated to write, and wouldn't be as clean as the event-based approach.