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']
);
製品のforeach
<?php if (!empty($product['model'])) { ?>
<h5 class="model"> <?php echo $product['model']; ?></h5>
<?php } ?>
何もで次のコードでも、私が編集したcategory.tplカテゴリページに表示されます。
他に何をすべきですか?
.tplファイルが少なくともそれを正しく表示できることをテストするために、静的テキストに 'model'を設定してみてください。 –
私は価格と名前を置き換えました。両方のケースで私は定義されていませんインデックスエラー –
Agis Soleas、print_r結果)をcategory.phpファイルに保存し、モデルの結果を確認しますか? –