We’re rewarding the question askers & reputations are being recalculated! Read more.
17

Solution 1 : You need to have all your categories UNDER the "Default Category". Then they should show. Solution 2 : Verify that Default Category Is Active (Enable category = "yes") and "Include in Navigation Menu" to Yes. Clear your cache by running the php bin/magento cache:clean command and check it will works. Update : Just go to the Stores -> All ...


11

You can add a block inside the customer_account_navigation and in that block, add the link to the parent block if your conditions are satisfied. So in your layout goes this: <customer_account> <reference name="customer_account_navigation"> <block type="[module]/customer_link" as="[module]_customer_link" name="[module]...


11

Try this: $collection = Mage::getResourceModel('catalog/category_collection') ->addAttributeToSelect('*') ->addAttributeToFilter('is_active', 1) //only active categories ->addAttributeToFilter('include_in_menu', 0) //only categories not included in menu ->addAttributeToFilter('parent_id', 10)//get only subcategories of the ...


11

Go to Catalog > Attributes > Manage Attributes Go to respective attribute code and click on it Go to Position Field and change the value there If you want size as first then followed by color and type. your Position value for the Size will be 1, it will be 2 for the Color etc.) Save it Clear cache and check the page


10

Somebody cracks open: app/code/core/Enterprise/PageCache/Model/Container/Catalognavigation.php Method: saveCache() Line 107 You see a nasty little regular expression: if (preg_match('/(?<=\s|^)nav-.+?(?=\s|$)/', $classValue, $matches)) { $categoryUniqueClasses .= ($categoryUniqueClasses ? ' ' : '') . $matches[0]; } Which is matching some devilry ...


9

Late to the party here, and I think you've probably already figured it out by now, but you need to have categories UNDER the "Default Category". Then they should show.


9

I had the same issue, I found a solution for this. I just removed the ttl attribute from /vendor/magento/module-theme/view/frontend/layout/default.xml and the menu bar appeared again.


8

$_category = Mage::getModel('catalog/category')->load(CATEGORY-ID); $_categories = $_category ->getCollection() ->addAttributeToSelect(array('name', 'image', 'description')) ->addIdFilter($_category->getChildren()); foreach ($_categories as $_category): echo $...


8

You need to create block for dynamic link 1) Define Your block class {vendor}\{Module}\Block\Customer\Link in navigation link <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock ...


7

If anyone is looking for a function just to dump out the whole category tree: <?php require_once '../app/Mage.php'; Mage::app(1); $rootCatId = Mage::app()->getStore()->getRootCategoryId(); function getTreeCategories($parentId, $isChild){ $allCats = Mage::getModel('catalog/category')->getCollection() ->...


6

I know this is quite old, but I'd like to share my solution anyway as it doesn't override/clone any core files. In your custom module add the following to your config.xml: <config> ... <frontend> <events> <catalog_controller_product_init> <observers> <...


6

There's a good article by Ecomdev that gives an example of how you can do this with the 'depends' functionality. Search for 'depends' on that page and it will demonstrate how to use a config value. e.g. <depends> <config>payment/checkmo/active</config> </depends> The menu item will only show if the check payment method is active....


6

Add this code in you active theme's default.xml <referenceContainer name="page.top"> <referenceBlock name="store.links" remove="true" /> </referenceContainer> And run command - php bin/magento cache:clean


6

Please follow the below steps. I have tried in default magento 1.9.3.1 and got the solution for this. Path: app/design/frontend/rwd/default/layout/customer.xml <reference name="left_first"> <block type="customer/account_navigation" name="customer_account_navigation" before="-" template="customer/account/navigation.phtml"> ...


5

To get the base url from another store there are, as far as I can see, 2 options. Build the url yourself: building the links yourself by retrieving a specific Store's url and prepending it $base_url = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); And then concatenating the category URL to it. [EDIT: second ...


5

If you are attempting this on ce-1.7 or later this can be done easily. Here is how I would do it. I would create a new category attribute (yes/no) called include_in_top_nav. Then override the method Mage_Catalog_Model_Observer::_addCategoriesToMenu() and add this code if (!$category->getIncludeInTopNav()) { continue; } right after if (!$...


5

The result you are getting is normal. The block with alias customer/account_navigation does not actually contain the customer account links. It acts only as a container where other layout files / modules can add links. If you use a new instance of the block this one will not contain any links. What I suggest is to add the following code to the layout handle ...


5

Change <li class="<!--active class here if child is current -->"> To <li<?php echo in_array($_category->getId(), Mage::registry('current_category')->getPathIds()) ? ' class="custom-active-class"' : '' ?>> EDIT: You need to add the category id to the cache key to make it work. Otherwise this solution wouldn't work with block ...


5

This happened to me when I made a custom theme. I created a theme.js file in app/design/fontend/<CUSTOM_THEME>/default/web/js/ to use some library I added. But I forgot to copy the code that where already there in the theme.js of the blank theme (/vendor/magento/theme-frontend-blank/web/js/theme.js). Here is the JavaScript line which clones the ...


4

I've been saying this a lot lately, but nobody pays attention :). Starting with CE 1.7 (and EE 1.12) the top menu is not rendered anymore by Navigation.php. That is only used for rendering catalog.leftnav (Browse By Category). The top menu is an instance of Mage_Page_Block_Html_Topmenu. The method responsable for generating the HTML for the menu is _getHtml ...


4

There's definitely no built-in possibility to do this. Also I don't see any quick and pretty way to achieve this without writing a module. The problem is to determine which of CMS pages have to be included into menu. In addition to the solution you just described I can also suggest creating a static block consisting of <li> nodes and then injecting ...


4

I don't know why configuration of navigation depth is setted for global. You can change settings adding system.xml to your local module. Add these configuration for store level of navigation depth: <?xml version="1.0"?> <config> <sections> <catalog> <groups> <navigation> ...


4

SO you have the main category id... $categoryId = 9; //get the category object $category = Mage::getModel('catalog/category') ->setStoreId(Mage::app()->getStore()->getId()) ->load($categoryId); Remember that all categories have a path setting where all the category tree from root to the category in question is kept. Something like: 1/2/5/...


4

As you are having Sort By option that means you have <?php echo $this->getToolbarHtml() ?> in your list.phtml file. Check in the catalog.xml whether you have called xml for pagination. The xml should be as below <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"> <...


4

Theory The topmenu part of magento is actually including via page.xml layout update file. This specific layout XML file is actually used to define magento's layout structure. This is how it is defined in there <block type="core/text_list" name="top.menu" as="topMenu" translate="label"> <label>Navigation Bar</label> <block ...


4

In your theme, make this file: Your/theme/Magento_Theme/templates/html/topmenu.phtml <?php /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ // @codingStandardsIgnoreFile ?> <?php /** * Top menu for store * * @var $block \Magento\Theme\Block\Html\Topmenu */ ?> <?php $columnsLimit = $block-...


4

To show your Custom Block Navigation , you simply need to create a widget Go to admin > content > widgets > add widget Select type as CMS static Block and choose your theme whichever you are using Fill all the details ( Title / Assign to Store Views / Sort Order to "0" Add layout update > Display on all pages / Container: After page header ...


4

That value stored in catalog_eav_attribute table. If you simply want to get all attributes that are set as filterable via the admin section then you need to filter on the table catalog_eav_attribute where the column is_filterable is true: /** @var Mage_Catalog_Model_Resource_Product_Attribute_Collection $attributeCollection */ $attributeCollection = Mage::...


4

You can do it by creating a simple module: Create registration file: app/code/Magenik/NavLink/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Magenik_NavLink', __DIR__ ); Create module.xml file: app/code/Magenik/NavLink/etc/module.xml <?xml ...


4

I have done by just overriding this file in my custom theme. app/design/frontend/Vendor/theme/Magento_Theme/templates/html/topmenu.phtml <?php $columnsLimit = $block->getColumnsLimit() ?: 0; $_menu = $block->getHtml('level-top', 'submenu', $columnsLimit); $currentUrl = $block->getCurrentUrl(); $objectManager = \Magento\Framework\...


Only top voted, non community-wiki answers of a minimum length are eligible