Allows to override the default current customer group identifier in the front-end requests.
The event allows to alter the
Cms_Controller::get_customer_group_id() method result,
effectively changing the current customer group on the front-end and thus possibly affecting
product prices and pages visibility. The handler function should return a customer group identifier
or nothing if changing the current customer group is not needed.
Usage example:
public function subscribeEvents()
{
Backend::$events->addEvent('cms:onGetCustomerGroupId', $this, 'get_customer_group_id');
}
public function get_customer_group_id($controller)
{
// Do not override the customer group for logged in customers
if ($controller && $controller->customer)
return $controller->customer->customer_group_id;
// Replace the "guest" customer group with some other group
return 10;
}