cancel
Showing results for 
Search instead for 
Did you mean: 

Assign custom attribute values to grid collection

SOLVED

Assign custom attribute values to grid collection

Hello all,

I have a created a custom grid in admin ,

I want to assign custom attributes from customer to one of the column in the grid , I can get the value of attribute from customer repository but how can I pass it  to collection?

 

Any help appreciated.

Thank You.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Assign custom attribute values to grid collection

Hello all,

I have resolved this by joining my collection with table

`customer_entity_varchar` 

 

$customerEav = $collection->getTable('customer_entity_varchar');

     $collection->getSelect()->join(
            array('customereav'=>$customerEav),
            '`order`.customer_id = customereav.entity_id AND customereav.attribute_id=214',
            ['custom_attribute' => 'customereav.value']);

 

hope this helps you as well.

Thank You.

View solution in original post

2 REPLIES 2

Re: Assign custom attribute values to grid collection

Hello all,

I have resolved this by joining my collection with table

`customer_entity_varchar` 

 

$customerEav = $collection->getTable('customer_entity_varchar');

     $collection->getSelect()->join(
            array('customereav'=>$customerEav),
            '`order`.customer_id = customereav.entity_id AND customereav.attribute_id=214',
            ['custom_attribute' => 'customereav.value']);

 

hope this helps you as well.

Thank You.

Re: Assign custom attribute values to grid collection

Thanks a lot

Solved my problem