Jump to content

Edit History

MKZ Industries

MKZ Industries

Based on my research in other answers, I have tried this in "modules\ps_mainmenu\ps_mainmenu.php" in the function "generateCategoriesmenu" and it seams it is working but only for the Main Meny bar, not for the category tree:

foreach ($categories as $key => $category) {
            $node = $this->makeNode([]);
            if ($category['level_depth'] > 1) {
                $cat = new Category($category['id_category']);
                if ((int)$cat ->id_category == 12) 
                    $link = "https://www.motorola.com";
                else
                    $link = $cat->getLink();
                // Check if customer is set and check access
                if (Validate::isLoadedObject($this->context->customer) && !$cat->checkAccess($this->context->customer->id)) {
                    continue;
                }
            } else {
                $link = $this->context->link->getPageLink('index');
            }    

Any ideas of how to make it work for the category tree?

MKZ Industries

MKZ Industries

Based on my research in other answers, I have tried this in "modules\ps_mainmenu\ps_mainmenu.php" in the function "generateCategoriesmenu" and it seams it is working but only for the Main Meny bar, not for the category tree:

foreach ($categories as $key => $category) {
            $node = $this->makeNode([]);
            if ($category['level_depth'] > 1) {
                $cat = new Category($category['id_category']);
                if ((int)$cat ->id_category == 12) 
                    $link = "https://www.motorola.com";
                else
                    $link = $cat->getLink();
                // Check if customer is set and check access
                if (Validate::isLoadedObject($this->context->customer) && !$cat->checkAccess($this->context->customer->id)) {
                    continue;
                }
            } else {
                $link = $this->context->link->getPageLink('index');
            }    

Any ideas of how to make it work for the category tree?

MKZ Industries

MKZ Industries

Based on my research in other answers, I have tried this in "modules\ps_mainmenu\ps_mainmenu.php" in the function "generateCategoriesmenu" and it seams it is working: 

foreach ($categories as $key => $category) {
            $node = $this->makeNode([]);
            if ($category['level_depth'] > 1) {
                $cat = new Category($category['id_category']);
                if ((int)$cat ->id_category == 12) 
                    $link = "https://www.motorola.com";
                else
                    $link = $cat->getLink();
                // Check if customer is set and check access
                if (Validate::isLoadedObject($this->context->customer) && !$cat->checkAccess($this->context->customer->id)) {
                    continue;
                }
            } else {
                $link = $this->context->link->getPageLink('index');
            }    

MKZ Industries

MKZ Industries

Based on my research in other answers, I am trying this in "modules\ps_mainmenu\ps_mainmenu.php" in the function "generateCategoriesmenu" but it is not working: 

foreach ($categories as $key => $category) {
            $node = $this->makeNode([]);
            if ($category['level_depth'] > 1) {
                $cat = new Category($category['id_category']);
                if ((int)$cat ->id_category == 12) 
                    $link = "https://www.motorola.com";
                else
                    $link = $cat->getLink();
                // Check if customer is set and check access
                if (Validate::isLoadedObject($this->context->customer) && !$cat->checkAccess($this->context->customer->id)) {
                    continue;
                }
            } else {
                $link = $this->context->link->getPageLink('index');
            }    

Any help with this?

×
×
  • Create New...