php - How to style products of a certain category in Opencart 2.3.0.2 -


i want add unique style products of category in opencart 2.3.0.2.

if want change style of particular category including html first

open

catalog/controller/extension/module/category.php 

at end of file find line:

return $this->load->view('extension/module/category', $data); 

here can add if else condition particular category id like:

if ($data['category_id'] == 25){             return $this->load->view('extension/module/categorycustom', $data); } else {             return $this->load->view('extension/module/category', $data); } 

add new file at:

catalog/view/theme/default/template/extension/module/categorycustom.tpl

and copy content from

catalog/view/theme/default/template/extension/module/category.tpl 

this change content of left side filter data.

if want change main content @ right side open:

catalog/controller/product/category.php 

find line around 377

$this->response->setoutput($this->load->view('product/category', $data)); 

add if else condition here change main content of page. like:

if ($category_info['category_id'] == 28){         $this->response->setoutput($this->load->view('product/categorynew', $data)); } else {         $this->response->setoutput($this->load->view('product/category', $data)); } 

now add new file at:

catalog/view/theme/default/template/product/categorynew.tpl 

copy content from:

catalog/view/theme/default/template/product/category.tpl 

this way can change layout of particular category page.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -