$template = 'category';
$validCategories = array(
'template_1' => array(45,46,29,59),
'template_2' => array(63),
'template_N' => array(111,222,333,666,777),
);
foreach ($validCategories as $tmpl => $categoriesList) {
if (in_array($category_id, $categoriesList)) {
$template = $tmpl;
break;
}
}
...
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/'.$template.'.tpl')) {
$this->template = $this->config->get('config_template') . '/template/product/'.$template.'.tpl'; // fixed
} else {
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) {
$this->template = $this->config->get('config_template') . '/template/product/category.tpl';
} else {
$this->template = 'default/template/product/category.tpl';
}
}