Magento: выберите группу клиентов при регистрации

Попытка добавитьgroup_id переключатель вMagento Pro v1.11

Следуя вместе с
http://phpmagento.blogspot.com/2012/01/how-to-show-customer-group-selecter-in.html а также
http://developersindia.info/magento/magento-override-frontend-controller.html,
 который работает до определенного момента, но group_id не записывается в БД.

мой модуль, пока:

Структура каталогов

app/code/local
- WACI
-- Customer
--- controllers
---- AccountController.php
--- etc
---- config.xml



config.xml

<config>
    <modules>
        <WACI_Customer>
            <version>0.1.0</version>
        </WACI_Customer>
    </modules>
    <global>
        <fieldsets>
            <customer_account>
                <group_id><create>1</create></group_id>
            </customer_account>
        </fieldsets>
    </global>
    <frontend>
        <routers>
            <customer>
                <args>
                    <modules>
                        <WACI_Customer before="Mage_Customer_AccountController">
                            WACI_Customer
                        </WACI_Customer>
                    </modules>
                </args>
            </customer>
        </routers>
    </frontend>
</config>



AccountController.php

<?php
/**
 *Customer account controller
 *
 * @package     WACI_Customer
 */

require_once Mage::getModuleDir('controllers', 'Mage_Customer').DS.'AccountController.php';

class WACI_Customer_AccountController extends Mage_Customer_AccountController
{

    /**
    * Create customer account action
    */
    public function createPostAction()
    {

// contents of createPostAction(), with some extra logic

            /**
             * Initialize customer group id
             */

            /* catch groupid at account creation */

            if($this->getRequest()->getPost('group_id')){ 
                $customer->setGroupId($this->getRequest()->getPost('group_id'));
            } else {
                $customer->getGroupId(); 
            } 



 // rest of method

    }

}




theme../persistent/customer/form/register.phtml

<div class="input-box">
    <label for="group_id"><?php echo $this->__('Select your customer group') ?></label><br />
    <?php 
        $groups = Mage::helper('customer')->getGroups()->toOptionArray();
        foreach ($groups as $group){
            echo '<input type="radio" name="group_id" value="'.$group['value'].'" class="validate-radio" >'.$group['label'].'</input><br/>';
        }
    ?>
</div>

Таким образом, переключатели с группами отображаются нормально при регистрации, но данные не записываются в базу данных, так как группа все еще показывает, как общие вadmin/manage customers

I don't really want to modify core files, as the article describes, I'm not certain that I'm properly overwriting the mage accountController class (maybe theres a better way to do this?)

What am I mucking up?

Ответы на вопрос(2)

Ваш ответ на вопрос