我已经使用Hwg属性管理器扩展(管理类别,客户和客户地址属性)向客户地址(选择地址类型商业或住宅)添加了自定义属性。它在后端工作。但问题不适用于前端。所以,我已经加入此代码
应用程序/设计/前端/基/默认/模板/客户/地址/ edit.phtmlMagento前端自定义属性值不保存数据
<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>
现在组合框出现在前端。但它不保存数据。然后我检查地址控制器中的提交表单值
$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) "" }
我'卡在这一点。
那么它被破坏或工作?这是答案还是问题? –