好的,所以我想为每个类别显示制造商徽标。制造商徽标应与类别相关,即移动电话类别应仅显示属于移动电话类别的制造商徽标,例如 Microsoft 或 Sony 的徽标不应在此处显示(移动电话类别),而是应显示在游戏机类别中。
目录/控制器/产品/category.php
$this->load->model('catalog/manufacturer');
$this->data['manufacturers'] = array();
$results = $this->model_catalog_manufacturer->getManufacturers();
foreach ($results as $result) {
$this->data['manufacturers'][] = array(
'manufacturer_image' => $this->model_tool_image->resize($result['image'],80,80),
'name' => $result['name'],
'href' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $result['manufacturer_id'])
);
}
类别.tpl
<?php foreach ($manufacturers as $manufacturer) { ?>
<img src="<?php echo $manufacturer['manufacturer_image']; ?>" />
<?php } ?>
目前它显示所有类别中的所有制造商徽标。