I'm trying to add thickbox effect to the product image when they show under category in grid view.
I have changed the link on the product image in the product/category.tpl
from:
to:<a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="thickbox"><img src="<?php echo $products[$j]['thumb']; ?>" title="<?php echo $products[$j]['name']; ?>" alt="<?php echo $products[$j]['name']; ?>" /></a>
Then I added the code marked in red to the controller/product/category.php<a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="thickbox"><img src="<?php echo $products[$j]['thumb']; ?>" title="<?php echo $products[$j]['name']; ?>" alt="<?php echo $products[$j]['name']; ?>" /></a>
However, the thickbox effect not working and the link on the product image appear like: Undefined variable : popup$this->data['products'] = array();
$results = $this->model_catalog_product->getProductsByCategoryId($category_id, $sort, $order, ($page - 1) * 12, 12);
$this->load->helper('image');
foreach ($results as $result) {
if ($result['image']) {
$image = $result['image'];
$popup = image_resize($image, $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
} else {
$image = 'no_image.jpg';
}
I thought I already defined it in the controller/product/category.php ? or is it I missed out something from the code?
Thank you!