2015-06-22 128 views
0

產品類別描述我一直在努力,以顯示我的類別描述進入產品列表頁面,但仍無法破解它。的Prestashop 1.6顯示產品列表頁

我嘗試了以下代碼並將其添加到我的product-list.tpl中;

($default_category->description) 

($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; 

然後下面的代碼添加到產品list.tpl修改getProductsProperties類,但它並沒有顯示任何東西。

<!-- Display categories --> 
<span id="product_categories"> 
{foreach from=$product.categories item=category name=category} 
{$category} <br/> 
{/foreach} 
</span> 

回答

0

請使用此代碼來顯示當前類別

description:{$category->description} 
+0

您好我試過的代碼肯定工作謝謝,但只有'description:'出現。 – phingko

0

描述:{$分類 - >描述衝

其@ user2314737

相關問題