Jump to content

Is there a dedicated categories page in Prestashop?


docprego@me.com

Recommended Posts

When I click on brands in the horizontal top menu I am brought to a page where I can view all of my brands. When I click on the categories link in the horizontal top menu, it responds completely different, I am brought back to my homepage.

 

Does a page exist within Prestashop where I can view all of my categories on one page in the same way I can view brands?

 

If such a page doesn't exist, how would I set one up? I installed a free module that showed the top level categories on my homepage. It was essentially what I wanted except that I want the categories to have a dedicated page and the link in the horizontal top menu to access this dedicated page. I could not figure out a way to use the homepage category module on a dedicated separate page and then link to it from the top horizontal menu.

 

Advice is greatly appreciated.

 

Thank you.

Link to comment
Share on other sites

category page can display all subcategories of currently viewed category page, so, does you category page has associated subcategories?

 

you said that you're redirected to homepage, what category page you trying to open?

Yes I can see subcategories on the currently selected category page.  But this is not what I am trying to achieve.

 

Let me clarify:

 

I have horizontal top menu installed.  Categories is a drop down called "Shop By Category" in this menu with some categories having subcategories.  Brands is also a drop down called "Shop By Brand" but there are no subcategories as I cannot find a way to enable them.  When I click on the "Shop By Category" link in the horizontal menu all that happens is that I am redirected to the homepage.  When I do the same for the "Shop By Brand" link I land on a page that displays all of my brands.   In both of these cases I am talking about physically clicking on these links, not hovering on them which cause the menus with the categories and brands to appear.

 

What I would like to do is have a page that I land on when I click on "Shop By Category" in the horizontal top menu that shows all of my categories and ideally the subcategories as well.  Something like the home categories module provides but on a page linked to the "Shop By Category" link in my horizontal top menu.

 

I have attached a photo of what my horizontal menu currently looks like.

 

 

Thank you

Horizontal Menu.tiff

Edited by [email protected] (see edit history)
Link to comment
Share on other sites

how you created "Shop By Category" element?

First In the top horizontal menu module I added "Categories", then I used the translation function to change the name to "Shop By Category."  Prestashop automatically provided the drop down menu once I did this.

 

My Categories Block module is set to :  Current category, unless it has no subcategories, in which case the parent category of the current category is used

 

Thanks

 
Link to comment
Share on other sites

so this is why you're redirected to home page of the shop when you click on it. Prestashop redirects "home" category to homepage by default.

to disable this feature it is necessary to alter files.

 

open classes/controller/frontcontroller.php

        // Automatically redirect to the canonical URL if needed
        if (!empty($this->php_self) && !Tools::getValue('ajax')) {
            $this->canonicalRedirection($this->context->link->getPageLink($this->php_self, $this->ssl, $this->context->language->id));
        } 

change it to

        // Automatically redirect to the canonical URL if needed
        if (!empty($this->php_self) && !Tools::getValue('ajax')) {
            $dont_redirect = 0;
            if (isset($this->category->id)){
                if ($this->category->id == 2) {
                    $dont_redirect = 1;
                }
            }
            if ($dont_redirect == 0){
                $this->canonicalRedirection($this->context->link->getPageLink($this->php_self, $this->ssl, $this->context->language->id));
            }
        }
Link to comment
Share on other sites

I changed the code and refreshed the cache but it did not work. I was still redirected to the homepage.

 

All I really want to do is place a link in the top horizontal menu that will land users on a page displaying all of my categories.

 

Amazingly I can't find a single module that does this.

 

Suggestions are greatly appreciated

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...