How to get product category URL Key?
-
31-10-2019 - |
문제
How can I get the product category's URL Key?
I can get the category name by $category->getName()
but it does not work if I use this $category->getURLKey()
,
$categories = $_product->getCategoryCollection()
->addAttributeToSelect('name');
foreach($categories as $category) {
$productCategoryName = $category->getName();
var_dump($category->getURLKey());
}
Return null
Any ideas?
올바른 솔루션이 없습니다
제휴하지 않습니다 magento.stackexchange