PRESTASHOP 1.6在产品列表页面上显示产品类别说明
我一直试图在产品列表页面中显示我的类别描述,但仍然无法破解它 我尝试了以下代码并将其添加到我的product-list.tpl中PRESTASHOP 1.6在产品列表页面上显示产品类别说明,prestashop,categories,Prestashop,Categories,我一直试图在产品列表页面中显示我的类别描述,但仍然无法破解它 我尝试了以下代码并将其添加到我的product-list.tpl中 ($default_category->description) 及 我知道我需要修改Product.php类函数,但我不确定是哪一个。 谁能给我指点一下吗 我试图通过添加 $results_array = array(); $categories_ids = Product::getProductCategories($row['id_product'])
($default_category->description)
及
我知道我需要修改Product.php类函数,但我不确定是哪一个。
谁能给我指点一下吗
我试图通过添加
$results_array = array();
$categories_ids = Product::getProductCategories($row['id_product']);
$categories_names = array();
foreach ($categories_ids AS $id) {
$category = new Category($id);
$categories_names[] = $category->getName();
}
$row['categories'] = $categories_names;
然后将以下代码添加到product-list.tpl,但它没有显示任何内容
<!-- Display categories -->
<span id="product_categories">
{foreach from=$product.categories item=category name=category}
{$category} <br/>
{/foreach}
</span>
{foreach from=$product.categories item=category name=category}
{$category}
{/foreach}
请使用此代码显示当前类别
description:{$category->description}
说明:{$category->description}
谢谢@user2314737您好,我尝试了代码,但只显示了“description:”。
description:{$category->description}