Page 1 of 1

Product page override

Posted: Fri Sep 01, 2017 9:15 pm
by redleaftea
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?

Re: Product page override

Posted: Thu Sep 07, 2017 12:34 am
by tdaubs
The following extension should solve the problem for you.

https://www.opencart.com/index.php?rout ... n_id=13400