我正在尝试在类别页面中加载image popup
,现在只能image thumb
我可以访问。
<div class="image">
<a href="<?php echo $product['popup']; ?>">
<img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" />
</a>
</div>
我从产品中复制代码
if ($category_info['image']) {
$this->data['popup'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
} else {
$this->data['popup'] = '';
}
并粘贴到controller / product / category.php下,但我收到错误消息
<b>Notice</b>: Undefined index: popup in <b>/home ...
Opencart版本:v1.5.5.1
答案 0 :(得分:0)
最后我找到了解决方案,
转到controller \ product \ category.php第212行粘贴
if ($result['image']) {
$popup = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_width'));
} else {
$popup = false;
}
之后的第244行
$this->data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
粘贴
'popup' => $popup,