Jump to content

blocktopmenu does not show URL link to browse category content


Recommended Posts

I have a new PS v1.6.1.0 with 105 categories. I configured the module blacktopmenu to show the relevant categories. The menu works fine. It shows each configured category and their child-categories.

 

The menu shows URL-links to browse the products available for each child-category. The problem is that it does not show this URL-link for the parent-category. The most annoying is that some categories have no child-categories and no URL-link is provided to browse its content. The address provided target the homepage: /index.php

 

The issue:

¿is this behaviour a bug?

¿is it a feature I need to enable somehow?

 

I do not see module configuration parameters to enable this.

 

Thanks in advance for your support.

Link to comment
Share on other sites

  • 3 months later...

Have you resolved this problem?

 

I have exactly the same problem. But I think the fix is available somewhere because TemplateMonster themes have this problem fixed. The Prestashop Demo at demo.prestashop.com doesn't have this problem either.

 

I've tried old and new versions of this module and the problem is always there.

 

Looks like that in blocktopmenu.php the $link is returing empty link

if ($category['level_depth'] > 1) {
                $cat = new Category($category['id_category']);
                $link = Tools::HtmlEntitiesUTF8($cat->getLink());
            } else {
                $link = $this->context->link->getPageLink('index');
            }

So it's always showing link to "index" page.

 

How to fix this?

Edited by woodland (see edit history)
Link to comment
Share on other sites

  • 9 months later...

try this in blocktopmenu.php : (it's works for me)

 

delete line 612 : 

$html .= '<a href="'.$link.'" title="'.$category['name'].'">'.$category['name'].'</a>';

and add :

if ($is_children == 0)
                $html .= '<a href="'.$category['id_category'].'-'.$category['link_rewrite'].'" title="'.$category['name'].'">'.$category['name'].'</a>';
            else
                $html .= '<a href="'.$link.'" title="'.$category['name'].'">'.$category['name'].'</a>';
Edited by ThomasHulin85 (see edit history)
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...