Magento根据产品(Product)获取类别(Category)名字及URL

Magento根据产品(Product)获取类别(Category)名字及URL

 $_categoryIds = $_product->getCategoryIds();   
    foreach ($_categoryIds as $_categoryId) {   
     $_category = Mage::getModel('catalog/category')->load($_categoryId);  
     $_category_name = $_category->getName();   
     $_category_url = $_category->getUrlPath();   
   
    } 

Leave a comment

您的邮箱地址不会被公开。 必填项已用 * 标注