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') Feb 28, 2020 at 7:46

1 Answer 1

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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