2014-10-08 2 views
0

안녕하세요, 판매 주문서에 맞춤형 고객 주소 속성을 표시하고 싶습니다.Magento의 판매 주문 그리드 컬렉션에 맞춤형 고객 주소 속성 추가

어떻게 달성할까요?

아래 내 컬렉션입니다. 다른 테이블의 테이블 필드를 추가했지만 고객/주소의 속성을 추가 할 수 없습니다.

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 AND 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); 

    return parent::_prepareCollection(); 
} 

감사합니다.

답변

0

아 누락 ​​Patbandha

코드에 따르면, 만 sales_flat_order_address의 필드를 추가 할 수 있습니다. customer address attribute to order grid then you need joincustomer/address 콜렉션을 추가하고 싶다면 on default shipping or billing address