0

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.

2 Answers 2

0

There is no built-in Magento option to do this, however you can create a product attribute Ex "category_grid", assigne products to that attribute and add it in the product grid view.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.