I am trying to render product_list.tpl
file in home.tpl
but it's giving me NULL
Controller File:
/controller/product/product_list.php
Code:
class ControllerProductProductList extends Controller {
public function index() {
$this->load->model('catalog/category');
$this->load->model('catalog/product');
$this->load->model('tool/image');
$filter_data = array(
'filter_tag' => 'featured',
'limit' => 9
);
$data['results'] = $this->model_catalog_product->getProducts($filter_data);
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/productlist.tpl')) {
$this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/common/productlist.tpl', $data));
} else {
$this->response->setOutput($this->load->view('default/template/common/productlist.tpl', $data));
}
}
}
Template to render
/template/product/productlist.tpl
Code:
<?php var_dump($results); ?>
<h2>Product are here</h2>
Then adding this line in home.php
controller
$data['special_mod'] = $this->load->controller('product/product_list');
and printing $special_mod
in common/home.tpl
file