Post by sasha-ua » Tue Dec 09, 2014 5:49 am

Hi!

I need to replace the main page(home.tpl) to a category with the goods(product/category).

As described here did not work:
http://forum.opencart.com/viewtopic.php?f=20&t=59830

home.tpl

Code: Select all

<?php $this->redirect($this->url->link('product/category', 'path=59')); ?>
Don't Work.

Newbie

Posts

Joined
Tue Dec 09, 2014 5:40 am

Post by fido-x » Tue Dec 09, 2014 1:44 pm

sasha-ua wrote:Hi!

I need to replace the main page(home.tpl) to a category with the goods(product/category).

As described here did not work:
http://forum.opencart.com/viewtopic.php?f=20&t=59830

home.tpl

Code: Select all

<?php $this->redirect($this->url->link('product/category', 'path=59')); ?>
Don't Work.
That may have worked in OC 1.5.6.x (or earlier) but it won't work in OC 2 (or beyond). You need to add the redirect to the controller.

In catalog/controller/common/home.php, insert the following:

Code: Select all

$this->response->redirect($this->url->link('product/category', 'path=59'));
near the beginning of the file after:

Code: Select all

$this->document->setKeywords($this->config->get('config_meta_keyword'));

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by sasha-ua » Tue Dec 09, 2014 4:17 pm

Big Thanks!

Newbie

Posts

Joined
Tue Dec 09, 2014 5:40 am
Who is online

Users browsing this forum: No registered users and 73 guests