Add customer in different group during registration in magento


If you want to add customer in different group during registration than follow this instruction.

You need to change in two files.
1) app\design\frontend\[your theme]\default\template\customer\form\register.phtml
add following code in the page

   <label for="group_id"><?php echo $this->__('Group') ?><span>*</span></label>
   <select name="group_id" id="group_id" title="<?php echo $this->__('Group') ?>" />
   <?php $groups = Mage::helper('customer')->getGroups()->toOptionArray(); ?>
   <?php foreach($groups as $group){ ?>
   <option value="<?php print $group['value'] ?>"><?php print $group['label'] ?></option>
   <?php } ?>

2) app\code\core\Mage\Customer\controllers\AccountController.php

now replace $customer->getGroupId(); with


This is good practise to override AccountController.php in your local directory

Comments are closed.