我使用 Hwg 属性管理器扩展(管理类别、客户和客户地址属性)向客户地址添加了一个自定义属性(以选择商业或住宅地址类型)。它在后端工作。但问题不适用于前端。所以我已将此代码添加到
app/design/frontend/base/default/template/customer/address/edit.phtml
<li class="fields">         
                <label for="billing:addresstype" class="required"><em>*</em><?php echo $this->__('Address Type') ?></label>
                <div class="input-box"> 
                    <select name="billingaddresstype" id="billingaddresstype">
                        <?php $collection = Mage::getResourceModel('eav/entity_attribute_option_collection');                           
                            $collection->setAttributeFilter(174);
                            $collection->setStoreFilter();
                            $collection->load();
                            $options = $collection->toOptionArray();
                            foreach ($options as $option) {
                                echo "<option value='".$option['value']."'>".$option['label']."</option>";             
                             }
                        ?>
                    </select><?php  //var_dump($options); ?>
                </div>
            </li>
现在组合框出现在前端。但它不保存数据。然后我检查 AddressController 中的提交表单值
 $addressForm = Mage::getModel('customer/form');
        $addressForm->setFormCode('customer_address_edit')
            ->setEntity($address);
        $addressData    = $addressForm->extractData($this->getRequest());
        var_dump($addressData);
        break;
它不包含我的自定义属性值。
array(11) { ["firstname"]=> string(8) "thushara" 
        ["lastname"]=> string(11) "Mannaperuma"
        ["company"]=> string(3) "flt"
        ["street"]=> array(2) 
            { [0]=> string(17) "1234 Heartwood Dr"   [1]=> string(0) "" } 
            ["city"]=> string(10) "Beltsville" 
            ["country_id"]=> string(2) "US" 
            ["region"]=> string(0) "" 
            ["region_id"]=> string(2) "31" 
            ["postcode"]=> string(5) "20705" 
            ["telephone"]=> string(12) "548-789-6548" 
            ["fax"]=> string(0) "" } 
我卡在这一点上。