0

How can I get all categories with all EAV attributes in the collection?

$categories = $objectManager->create('Magento\Catalog\Model\ResourceModel\Category\Collection');
$categories->addAttributeToSelect('*');

$categories->getData(); give me the following data

enter image description here

I want all available EAV attributes in this collection

1
  • Try this $categories->getData('attribute_code')
    – Rk Rathod
    Feb 28 '20 at 7:46
0

You can use below code so that it will give all details in array:

$categories = $objectManager->create('Magento\Catalog\Model\ResourceModel\Category\Collection');
$categories->addAttributeToSelect('*');
echo "<pre>";
print_r($categories->toArray()); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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