Product page override
Posted: Fri Sep 01, 2017 9:15 pm
In OC2 I replace this line in the product.php config file:
$this->response->setOutput($this->load->view('product/product', $data));
With the below
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/' . $template)) {
$this->setData($data, 'pco_color_selector_style', '');
$this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/' . $template, $data));
} else {
$this->setData($data, 'pco_color_selector_style', '');
$this->response->setOutput($this->load->view('default/template/product/product.tpl', $data));
}
To allow for different products to trigger different template files on the product page.
I'm trying to replicate this behavior in OC3 but so far no joy, other than replacing the tpl extension with twig is there anything else I'm missing?
$this->response->setOutput($this->load->view('product/product', $data));
With the below
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/' . $template)) {
$this->setData($data, 'pco_color_selector_style', '');
$this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/' . $template, $data));
} else {
$this->setData($data, 'pco_color_selector_style', '');
$this->response->setOutput($this->load->view('default/template/product/product.tpl', $data));
}
To allow for different products to trigger different template files on the product page.
I'm trying to replicate this behavior in OC3 but so far no joy, other than replacing the tpl extension with twig is there anything else I'm missing?