php - Add custom customer address attribute in sales order grid collection in magento -
Hi I want to show in the Sales Order Grid some custom customer address attributes.
How to get that
?
Below is my archive I have successfully included table areas from another table, but unable to add properties to customer / address
protected function_prepareCollection () {$ Collection = Dana :: getResourceModel ('sales / order_grid_collection'); $ COLLECTION- & gt; getSelect () - & gt; JoinLeft (array ('sfoa' = & gt; 'sales_flat_order_address'),' main_table.entity_id = sfoa.parent_id and sfoa.address_type = "shipping" ', array (' sfoa.street ',' Sfoa.city ',' sfoa .company ',' sfoa.customer_address_id ')); $ COLLECTION- & gt; AddFieldToFilter ('CUSTOMER_ID', Dana :: Registry ('current_customer') - & gt; getId ()) - & gt; SetIsCustomerMode (true); Dana :: Log ($ Collection); $ This- & gt; setCollection ($ Collection); Return parent: _ prepareCollection (); } Thanks guys. According to your code, you can only send sales_flat_order_address
/ Code> You can then add to add a customer address attribute to order a grid, then you need to join for customer / address Archive with default shipping or billing address
Comments
Post a Comment