我想在我的产品列表页面中显示类别描述(在过滤器部分中)。但是我只有类别的名称和id,并且在类别类中找不到也给我描述的方法。
你能帮助我吗? :)
我能够使用此方法获取类别信息:
{assign var='cat' value=Category::getNestedCategories($categoryId)}
{$cat[categoryId].description nofilter}
谢谢您的帮助。
使用以下代码创建覆盖Link.php:
Class Link extends LinkCore {
public function getInfoCateg($idc) {
$category = new Category($id);
return $category->description;
}
}
在你的tpl:
{$link->getInfoCateg($product.id_category_default)}
并清除缓存文件。
问候
尝试使用以下代码获取类别说明。
$categories_id = Product::getProductCategories($row['id_product']);
$category = new Category($id);
$description = $category->description;