Jump to content

Have the home page show the home category products


Recommended Posts

I fiddles a bit with the category.php file and found:

if ($category->id != 1)
       {
           $nbProducts = $category->getProducts(NULL, NULL, NULL, $orderBy, $orderWay, true);
           include(dirname(__FILE__).'/pagination.php');
           $smarty->assign('nb_products', $nbProducts);
           $cat_products = $category->getProducts(intval($cookie->id_lang), intval($p), intval($n), $orderBy, $orderWay);
}




Basically if I comment out the if statement portion I can get the home categories to show (The id != 1 is basically saying show any category except home which is category 1)

Is there a way to get around editing this source file? Like a mod or something? I would like to keep the system files untouched so when there's an update everything doesn't break.

I don't think I can use a template file because the category.tpl is pointless unless of course I comment out that if statement.

Link to comment
Share on other sites

cool thanks. I went with copying the category.php code with a custom tpl and pasted it into index.php.

I was wondering though, since index.php is a source file and I don't when to alter it, and i tried using the index.php in my theme folder which didn't work, is there a way I can have this code in my theme directory? Or is a custom module basic the only route for unaltered source files?

Link to comment
Share on other sites

×
×
  • Create New...