I have a store in which one 'product' needs to use a different product/product.tpl file. I see some help code from 1.5 where some things are added to the controller file but it looks like the code in there has changed in 2.0.
Any help would be greatly appreciated.
Think I figured it out with some help from the old 1.5 notes.
In controller/product/product.php
Changed
To
In controller/product/product.php
Changed
Code: Select all
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {
$this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/product.tpl', $data));
} else {
$this->response->setOutput($this->load->view('default/template/product/product.tpl', $data));
}
Code: Select all
if($this->request->get['product_id'] == '55') { // If ID matches this, use this new template
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product_new.tpl')) {
$this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/product_new.tpl', $data));
} else {
$this->response->setOutput($this->load->view('default/template/product/product.tpl', $data));
}
} else { // If not, use standard
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {
$this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/product.tpl', $data));
} else {
$this->response->setOutput($this->load->view('default/template/product/product.tpl', $data));
}
}
Who is online
Users browsing this forum: No registered users and 3 guests