- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2020
11:09 AM
09-25-2020
11:09 AM
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.
Labels:
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2020
06:15 AM
09-26-2020
06:15 AM
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.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2020
06:15 AM
09-26-2020
06:15 AM
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.