您好我一直在关注本教程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>
答案 0 :(得分:0)
我希望现在应该清楚。
答案 1 :(得分:0)
更新
我通过安装此扩展程序http://cjmcreativedesigns.com/customer-group-at-registration.html
解决了这个问题