嗨,我一直在关注本教程http://sabujcse.wordpress.com/2010/03/09/selecting-customer-group-during-registration-in-magento/并成功地为注册过程添加了功能。
然后,我重用了编辑帐户页面 (edit.phtml) 的代码,并对其稍作修改。但是,当提交表单时,组不会更新
我错过了什么?
Current Group<br/>
<?php
$TypeID = Mage::getSingleton('customer/session')->getCustomerGroupId();
//Get customer Group name
$type = Mage::getModel('customer/group')->load($TypeID);
$customerType = $type->getCode();
echo $customerType;
?>
<div class="input-box">
<label for="group_id"><?php echo $this->__('Which Best Describes You') ?><span class="required">*</span></label><br/>
<select name="group_id" id="group_id" title="<?php echo $this->__('Group') ?>" selected="" class="validate-group required-entry input-text" />
<?php $groups = Mage::helper('customer')->getGroups()->toOptionArray(); ?>
<?php foreach($groups as $group){ ?>
<option <?php if ($customerType == $group['label']) { echo "selected"; } ?> value="<?php print $group['value'] ?>"><?php print $group['label'] ?></option>
<?php } ?>
</select>
</div>