php - Add custom customer address attribute in sales order grid collection in magento -
hi want show custom client address attribute in sales order grid.
how accomplish ?
below collection. have added table fields table unable add together attributes customer/address
protected function _preparecollection() { $collection = mage::getresourcemodel('sales/order_grid_collection'); $collection->getselect()->joinleft(array('sfoa'=>'sales_flat_order_address'), 'main_table.entity_id = sfoa.parent_id , sfoa.address_type="shipping"',array('sfoa.street', 'sfoa.city','sfoa.company','sfoa.customer_address_id')); $collection->addfieldtofilter('customer_id', mage::registry('current_customer')->getid()) ->setiscustomermode(true); mage::log($collection); $this->setcollection($collection); homecoming parent::_preparecollection(); }
thanks guys.
anurag patbandha
according code ,you can add together fields of sales_flat_order_address
. if want add together customer address attribute order grid need join
customer/address
collection on default shipping or billing address
php magento magento-1.7
No comments:
Post a Comment