1

如果你看看: http ://www.gilliesaudio.co.uk/index.php?route=product/category&path=62

您将看到产品“传单”和“海报”没有类别图像。

这是我在主题/默认/模板/产品/category.tpl中所能得到的:

  <div>
      <?php if ($product['thumb']) { ?>
      <div class="image">
      <a href="<?php echo $category['href']; ?>">
      <img src="<?php echo $category['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" />
      </a>
      </div>

      <?php } ?>
          <a href="<?php echo $category['href']; ?>">
              <?php echo $category['name']; ?>
          </a>
  </div>

无论我怎么努力,我都无法显示图像?我究竟做错了什么?

提前致谢!汤姆

4

1 回答 1

1

controller/product/category.php在文件中找到这一行:

            $this->data['categories'][] = array(
                'name'  => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),
                'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)

并将它们替换为:

            $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
            $thumb = $this->model_tool_image->resize($result['image'], 100, 100); // you can use your own size
            $this->data['categories'][] = array(
                'image' => $image,
                'thumb' => $thumb,
                'name'  => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),
                'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)

并在循环中使用$catgory['image']$catgory['thumb']

foreach ($categories as $category) { 

tpl 文件view/product/category.php

于 2012-10-04T20:02:17.460 回答