after add new custom attribute, i am trying to get my custom attribute category, filter by the parent id, actually it return me a null value or empty array I used $category->getData('label_text'), $category->getLabelText(), $category->getCustomAttribute('label_text')... Do i have to join catalog_category_varchar and eav_attribute to reach it ? If someone of you have some advices. thanks

  • how are you getting your $category instance?
    – Marius
    Commented Jun 10, 2020 at 13:53
  • with $category = $objectManager->create('Magento\Catalog\Model\Category')->load($entityId);
    – lisa
    Commented Jun 10, 2020 at 14:44
  • Please check your attribute's options. It must be visible on frontend otherwise will not be included in collection. Commented Jun 10, 2020 at 15:10

1 Answer 1


Install/Upgrade script:

            // ...
            'used_in_product_listing' => true, // for category pages
            'visible_on_front' => true, // for frontend??
            'is_used_in_grid' => true, // for category pages
            'is_visible_in_grid' => true // for category pages

also on the collection do:


and then in the template you can just call:

// or

If still not work run below command:

php bin/magento in:reindex

And more information this link ---


Hope this help you

Thanks ...

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.