2013-04-11 172 views
0

我想在类别页面加载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'] = ''; 
} 

复制代码,并在控制器/产品/ category.php粘贴,但我只是得到错误信息

<b>Notice</b>: Undefined index: popup in <b>/home ... 

Opencart的版本:v1.5.5。 1

回答

0

最后我找到了解决方案,

去控制器\产品\ 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, 
+0

所以接受(通过点击刻度上答案的左边)你自己的答案知道这个问题被正确地回答。 – shadyyx 2013-04-12 10:04:43

相关问题