Magento system.xml groups multiselect

Magento system.xml groups multiselect

September 3, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento system.xml groups multiselect

Expanding Customer Group Options in Magento

Magento’s system.xml file provides a robust way to configure various settings within your store. In this post, we’ll delve into the Multiselect frontend type used for customer group configuration and explore how to add an additional option, specifically “NOT LOGGED IN”.

Understanding the Existing Configuration

By default, Magento configures three customer groups in the admin panel:

  1. General - Applies to all customers.
  2. Retailer
  3. Wholesaler

These are defined by the following configuration in your system.xml file:

<frontend_type>Multiselect</frontend_type>
<source_model>adminhtml/system_config_source_customer_group_multiselect</source_model>

The source_model attribute points to a model that generates the options for this field. Let’s take a closer look at this model.

System Config Source Customer Group Multiselect

The adminhtml/system_config_source_customer_group_multiselect model is responsible for generating the list of customer groups. It’s located in the app/code/core/Mage/Adminhtml/Model/System/Config/Source/CustomerGroup/Multiselect.php file.

Upon inspection, you’ll notice that this model hardcodes the available options to “General”, “Retailer”, and “Wholesaler”. This is why only these three groups appear in your admin panel.

public function getAllOptions() {
    return array(
        'values' => array(
            0 => array(
                'value'     => '',
                'label'     => Mage::helper('adminhtml')->__('General')
            ),
            1 => array(
                'value'     => 'Retailer',
                'label'     => Mage::helper('adminhtml')->__('Retailer')
            ),
            2 => array(
                'value'     => 'Wholesaler',
                'label'     => Mage::helper('adminhtml')->__('Wholesaler')
            )
        )
    );
}

Adding the “NOT LOGGED IN” Option

To add a fourth option for “NOT LOGGED IN”, you have two main approaches:

Approach 1: Override the Customer Group Model

You can create an extension that overrides the Mage_Adminhtml_Model_System_Config_Source_CustomerGroup_Multiselect model. In your custom model, you would modify the getAllOptions() method to include the “NOT LOGGED IN” option.

Here’s a simple example of how this could look:

public function getAllOptions() {
    $options = parent::getAllOptions();
    array_unshift($options['values'], array(
        'value'     => 'none',
        'label'     => Mage::helper('adminhtml')->__('NOT LOGGED IN')
    ));
    return $options;
}

Remember, when overriding a core model, it’s crucial to follow best practices for extension development to ensure your changes are preserved across Magento updates.

Approach 2: Use the Customer Groups API

Magento provides an API for managing customer groups. You can create or update a group with NOT LOGGED IN as the name programmatically or via admin panel actions.

For example, you could use the following in a script:

$customerGroup = Mage::getModel('customer/group');
$customerGroup->setCode('none')
              ->setTaxClassId(0)
              ->save();

This would create a new group named “NOT LOGGED IN” with default tax settings.

Conclusion

Expanding the customer group options in Magento requires either overriding core models or utilizing the built-in API. Both approaches offer valid solutions but come with their own trade-offs in terms of complexity and maintainability.

At LaravelCompany, we recommend using a proper extension development methodology if you choose to override core models. This ensures your changes are preserved across Magento updates, providing a more stable long-term solution.

Remember, before making any system-wide changes, always backup your data and test thoroughly in a staging environment.

Happy coding!

Admin Configuration Customers

Our network