Page 1 of 1

how to get category 20 on homepage

Posted: Wed Oct 13, 2010 12:26 am
by dukejustice
Hi.

On OpenCART 1.4.9.1, clean and fresh install, with very few minor templating modifications into a NEW theme subdirectory...

After searching this forum and not having solved my issue with http://forum.opencart.com/viewtopic.php?f=20&t=9968 nor http://forum.opencart.com/viewtopic.php ... 9&start=15 and the like, I am bound to ask for help.

How can I get category 20 to show up on front page just as if the visitor clicked that category (without a redirection - SEO's hate redirections).

As mentionned above, changing

Code: Select all

$action = new Action('common/home');
to anything has lead me to failure.

Any help or pointer is appreciated.

Best regards.

Duke

Re: how to get category 20 on homepage

Posted: Wed Oct 13, 2010 8:19 pm
by JAY6390
Open index.php in your main directory
FIND:

Code: Select all

// Router
if (isset($request->get['route'])) {
    $action = new Action($request->get['route']);
} else {
    $action = new Action('common/home');
} 
REPLACE WITH:

Code: Select all

// Router
if (isset($request->get['route']) && $request->get['route'] != 'common/home') {
    $action = new Action($request->get['route']);
} else {
    $request->get['path'] = 20;
    $action = new Action('product/category');
} 

Re: how to get category 20 on homepage

Posted: Tue Oct 19, 2010 4:32 am
by dukejustice
Wow!

Thanks a lot. That did the trick.

Best regards

Duke

Re: how to get category 20 on homepage

Posted: Tue Jul 12, 2011 7:52 am
by pixelpuncher
thanks for this!

Re: how to get category 20 on homepage

Posted: Wed Apr 15, 2015 9:38 pm
by RHTDM
How to show category based product on homepage?

I am using open cart 2.0.2.0 version.

Thanks