magento客户地址属性不保存在sales_flat_order_address,首先,你需要将属性添加到存储的报价和订单的地址表。这可以通过安装脚本来完成。
然后,你将需要处理的地址转换,这样,当你把你将采取从报价地址属性,并将其添加到所创建的订单和客户地址的顺序。 <sales_convert_quote_address> <your_attribute> <to_order_address>*</to_order_address> <to_customer_address>*</to_customer_address> </your_attribute> </sales_convert_quote_address> 你必须创建你的模块的config.xml这个条目: <global> <fieldsets> <sales_convert_quote_address> <yourfield> <to_customer_address>*</to_customer_address> <to_order_address>*</to_order_address> </yourfield> </sales_convert_quote_address> <customer_address> <yourfield> <to_quote_address>*</to_quote_address> </yourfield> </customer_address> </fieldsets> </global> 和手动或通过在数据库中的表安装脚本: $sales_flat_quote_address = $this->getTable('sales/quote_address'); $installer->run("ALTER TABLE $sales_flat_quote_address ADD `yourfield` varchar(255) NOT NULL"); $sales_flat_order_address = $this->getTable('sales/order_address'); $installer->run("ALTER TABLE $sales_flat_order_address ADD `yourfield` varchar(255) NOT NULL"); (责任编辑:最模板) |