I have a grid in admin where I am showing orders based on some filters,
I want to show the category of ordered item in one of the column ,How can I do that?
Thank you.
Solved! Go to Solution.
Hello ,
I have resolved this by joining grid collection with table
catalog_category_entity_varchar $categoryNameTable=$collection->getTable('catalog_category_entity_varchar');
$collection->getSelect()->join(
array('category_name'=>$categoryNameTable),
'`category_product`.category_id = category_name.row_id AND category_name.attribute_id=45',
['catalog' => 'GROUP_CONCAT(DISTINCT category_name.value)']);Thank you.
Hello ,
I have resolved this by joining grid collection with table
catalog_category_entity_varchar $categoryNameTable=$collection->getTable('catalog_category_entity_varchar');
$collection->getSelect()->join(
array('category_name'=>$categoryNameTable),
'`category_product`.category_id = category_name.row_id AND category_name.attribute_id=45',
['catalog' => 'GROUP_CONCAT(DISTINCT category_name.value)']);Thank you.