I would like to create page specific template files for opencart 2.0.1.1 using the "location" field. I would like to know can this work with seo url's I have found this at the bottom of the header.php for opencart 2.0.1.1
// For page specific css
if (isset($this->request->get['route'])) {
if (isset($this->request->get['product_id'])) {
$class = '-' . $this->request->get['product_id'];
} elseif (isset($this->request->get['path'])) {
$class = '-' . $this->request->get['path'];
} elseif (isset($this->request->get['manufacturer_id'])) {
$class = '-' . $this->request->get['manufacturer_id'];
} else {
$class = '';
}
$data['class'] = str_replace('/', '-', $this->request->get['route']) . $class;
} else {
$data['class'] = 'common-home';
}
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/header.tpl')) {
return $this->load->view($this->config->get('config_template') . '/template/common/header.tpl', $data);
} else {
return $this->load->view('default/template/common/header.tpl', $data);
}
I believe this to be the code structure for page specific css only I want to change page specific .tpl files. I would like to use a switch control method, I will using at least 5 templates for different products. Something like this example below from opencart 1.5x. would be perfect
OpenCart - View alternate product template based on arbitrary product field