I want to create a category collection which I can filter by its parent category id. How to do this?
1 Answer
Please use below code:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager ->create('Magento\Catalog\Model\ResourceModel\Category\Collection');
$category->addAttributeToSelect('*')->addAttributeToFilter('parent_id',['eq'=>3]);