0
我試圖在類別頁面中顯示產品模型。 我在/catalog/controller/product/category.php添加 'model'=> $result['model']
在類別頁面中顯示產品模型opencart
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'minimum' => $result['minimum'] > 0 ? $result['minimum'] : 1,
'rating' => $result['rating'],
'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url),
'model' => $result['model']
);
我也有編輯category.tpl與產品的foreach
<?php if (!empty($product['model'])) { ?>
<h5 class="model"> <?php echo $product['model']; ?></h5>
<?php } ?>
,但沒有下面的代碼顯示在類別頁面中。
我還應該做什麼?
嘗試設置「模式」爲靜態文本,以測試該.tpl文件是至少能夠正確顯示 –
我更換價格,名稱,並在這兩種情況下,我得到未定義指數誤差 –
阿吉斯Soleas,嘗試的print_r($結果)在category.php文件中,並檢查它給模型的結果? –