I want to get all categories names from a specific store. I'm trying:
$categoryFactory = $objectManager->create('Magento\Catalog\Model\ResourceModel\Category\CollectionFactory');
$categories = $categoryFactory->create()
->addAttributeToSelect('*')
->setProductStoreId($store->getId());
foreach ($categories as $category){
$category->getName();
}
But it shows all the categories in the same language (same-store view).
So ->setProductStoreId($store->getId())
doesn't work.
I'm also tried $category->setStoreId($store->getId())->getName()
.
How can I get all the categories names for specific store view?
Best Answer
Try this :