Post by dukejustice » Wed Oct 13, 2010 12:26 am

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

Newbie

Posts

Joined
Wed Oct 13, 2010 12:21 am

Post by JAY6390 » Wed Oct 13, 2010 8:19 pm

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');
} 

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by dukejustice » Tue Oct 19, 2010 4:32 am

Wow!

Thanks a lot. That did the trick.

Best regards

Duke

Newbie

Posts

Joined
Wed Oct 13, 2010 12:21 am

Post by pixelpuncher » Tue Jul 12, 2011 7:52 am

thanks for this!

Newbie

Posts

Joined
Sun Jul 03, 2011 3:09 pm

Post by RHTDM » Wed Apr 15, 2015 9:38 pm

How to show category based product on homepage?

I am using open cart 2.0.2.0 version.

Thanks

New member

Posts

Joined
Thu Oct 21, 2010 2:28 am
Who is online

Users browsing this forum: No registered users and 34 guests