您好,我是magento2的新手
我想从指定的类别ID获取类别名称有人可以帮忙吗?
提前致谢
尝试使用以下代码在Magento2中获取类别对象:
$categoryId = 3;
$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $_objectManager->create('Magento\Catalog\Model\Category')
->load($categoryId);
echo $category->getName();
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句