Jump to content

Link to home category gives 404


Recommended Posts

Hello, i add a link in megamenu to home cateogry(default root) and when i try to access thta page i get a 404 error message.

 

i am on 1.6.0.8 , multistore enabled (default root category for active store is home). All my categories all listed under home.

 

Has anyone faced something similar?

 

Thanks,

C

  • Like 1
Link to comment
Share on other sites

Hello, i add a link in megamenu to home cateogry(default root) and when i try to access thta page i get a 404 error message.

 

i am on 1.6.0.8 , multistore enabled (default root category for active store is home). All my categories all listed under home.

 

Has anyone faced something similar?

 

Thanks,

C

Yes I am facing the same problem

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...

Same here...

 

I just found, and traced the problem. Line number : 64-65 in CategoryController

the condition in canonicalRedirection():

if (!Validate::isLoadedObject($this->category) || !$this->category->inShop() || !$this->category->isAssociatedToShop() || in_array($this->category->id, array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY'))))

in CategoryController does trigger. Which means, one of the four conditions is true. In my case, maybe yours too, it's the fourth
:

in_array($this->category->id, array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY'))

I don't know WHY, but the controller check if the category accessed is either the root category or the home one. In our case it is the root...So we got two choices: Override this controller and forget that condition (I don't think it's a good idea) create a new category and use it instead (Better?)

 

The first possibility might be dangerous, the PS team didn't wanted us to access the home category and the root category in any way, there must be a reason.

 

The second is quite...easier, but might cause a problem to some people...

 

Martin

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...