I have category ID and need to get all custom attribute for example thumbnail image.
my code does not return all attributes
$category = $this->categoryRepository->get($childId, $this->_storeManager->getStore()->getId());
$category->getData();
I have category ID and need to get all custom attribute for example thumbnail image.
my code does not return all attributes
$category = $this->categoryRepository->get($childId, $this->_storeManager->getStore()->getId());
$category->getData();
2
Answers
Try below code:
I hope it will help…!!!
You can use Category’s
CollectionFactory
class and select all attributes by using astar (*)
symbol inaddAttributeToSelect
method. You can use this code example below in your class.