Post by andrei.bogdan » Wed Sep 04, 2013 4:12 pm


- This mod is useful if you want custom/different layouts/colors for some certain categories of your store.
- Open Cart has, by default, only one category.tpl file that is used to display all categories.
- This vqmod will allow you to have a different category.tpl file for each category and for each information page!
- It works the same as Wordpress category hierarchy, if you do not have a custom category file(ex: category_34.tpl or category_34_37.tpl), then the default category.tpl will be loaded.
- It is as simple as that.


- For example, if you have a category with id 34, then you will create a category_34.tpl file and this will automatically be loaded to your category page. If you have a child category with id 37 and parent id is 34, you will create a category_34_37.tpl file.

- Make sure you have created a file with the id of the desired category as suffix(ex: for category with id 12 you will create a file category_12.tpl)
- This module has only been tested with OpenCart and OpenCart
- It might not work with previous versions of OpenCart, use at own risk! It only virtually modifies OpenCart files, so no need to worry.


Themes and Extensions

Active Member


Mon Mar 25, 2013 4:52 am

Post by Anijack » Wed Feb 19, 2014 5:20 pm

Hi Andrei

Thanks for the response. I am currently using vqmod to override the the product.php file. I have tested the vqmod file you linked me to but sadly it has the same issue as my script in that it doesn't work when Search Engine Friendly URLs are enabled in joomla.

I know it has something to do with $this->request->get['path']; not being able to get the path if it is not in the page URL. However I don't understand this because I have read in other posts that $this->request->get['path']; should work regardless of whether SEF URLs are being used or not.

I have tested this by echoing out $this->request->get['path']; with SEF on and off. When SEF is off the path is echoed out but not with SEF on.



Tue Feb 18, 2014 8:10 pm

Post by Anijack » Wed Feb 19, 2014 10:09 pm


I probably should have mentioned I am using Mijoshop. This is the code I had to use to get it working with SEF URLs on.

Code: Select all

$category_id = MijoShop::get('db')->getProductCategoryId($this->request->get['product_id']);
$strStrip = MijoShop::get('db')->getParentCategoryId($category_id);
$this->template = $this->config->get('config_template') . '/template/product/product_' . $strStrip . '.tpl';
if (!file_exists(DIR_TEMPLATE . $this->template)) {
	 $this->template = $this->config->get('config_template') . '/template/product/product.tpl';
Thanks for your help.



Tue Feb 18, 2014 8:10 pm
Who is online

Users browsing this forum: No registered users and 8 guests