Jump to content

How do I change the "Products" button URL in the top menu?


5haun

Recommended Posts

the question is: how you added it? this is simple link? or link to category page? 

 

The link is the default link on the default theme - when you mouse over it, it show a drop-down of all the categories.

I have not modified it yet.

 

I just want it to go to my /products cms page intead of /index.php.

 

See what I mean?

Link to comment
Share on other sites

when you make a category and put it in the topmenu module it will automaticly link to that category. do you mean that?

No not exactly.

 

I want to change the link "Products" in the top menu. I want it to go to one of my cms pages when clicked instead of index.php

Link to comment
Share on other sites

No not exactly.

 

I want to change the link "Products" in the top menu. I want it to go to one of my cms pages when clicked instead of index.php

I think you should try this open the module of the top menu.

 

When opened the menu add a new Label "name"

Link "the page you wish to go to"

 

save it.

 

then add it to the menu in the same module

Link to comment
Share on other sites

I think you should try this open the module of the top menu.

 

When opened the menu add a new Label "name"

Link "the page you wish to go to"

 

save it.

 

then add it to the menu in the same module

Okay yes I see what you are saying but that is not what I want.

 

I need to change the link on "Products" because it has that drop-down menu of all the categories.

 

I can easily add a new button and link it to my cms page but that's not what I want.

Link to comment
Share on other sites

  • 1 month later...

I managed to solve this.

I changed my mind I wanted link to go to a category page instead of /products.

 

So I modified this code

$link = $this->context->link->getPageLink('index');

to

$link = $this->context->link->getCategoryLink('74');

in blocktopmenu.php like this:

    private function generateCategoriesMenu($categories)
    {
        $html = '';

        foreach ($categories as $key => $category)
        {
            if ($category['level_depth'] > 1)
            {
                $cat = new Category($category['id_category']);
                $link = Tools::HtmlEntitiesUTF8($cat->getLink());
            }
            else
                $link = $this->context->link->getCategoryLink('74');
Link to comment
Share on other sites

×
×
  • Create New...