Category Configuration
Category Configuration
Catalog-> Manage Categories
Anchor and non anchor category pages
Categories in Magento can be anchor and non anchor (set to Is Anchor
= Yes
in category management or not). For layered navigation, based on attributes, to work in Magento it is mandatory to set category and all its subcategories Is Anchor
to Yes
.
Above: To make category
Anchor
in Magento admin panel selectCatalog
->Manage Categories
menu, select some category and openDisplay settings
tab.
Non Anchor Category
- contains only products directly assigned to it. By default only block of categories is displayed and products cannot be filtered with Layered Navigation.
Anchor category
- differently from non anchor category it contains products assigned to it and to all subcategories. Also Layered Navigation is shown.
Above is typical non anchor Magento category page example
There are 2 typical store setups:
- All categories are anchor. In this case all categories can be filtered with layered navigation.
- First level or two of category tree is non-anchor and deeper categories are anchor. In this setup top categories typically do not show products, and instead they show thumbnails for deeper subcategories, and deeper subcategories show both layered navigation and products.
Either way, when some category is anchor, all its subcategories should be anchor too.
Enabling Or Disabling Category Showing In Layered Navigation
Extension adds a General
tab into standard Magento category management screen. Here you can either enable or disable the category showing in Layered Navigation.
- In order to access category configuration go to menu
Catalog-> Manage Categories
in Magento Admin Panel. - In category tree select the one and open
General
tab. Show In Layered Navigation Filter parameter let to enable or disable category showing in Layered Navigation.
Mass Enabling For All Existing Categories
After extension is installed, all categories are enabled for Layered Navigation. But if category data are imported from external system, it can be needed to enable them after that.
Here is the script, which can help to enable all categories for Layered Navigation:
INSERT INTO `catalog_category_entity_int`(`entity_type_id`,
`attribute_id`,
`entity_id`,
`store_id`,
`value`)
SELECT e.entity_type_id,
a.attribute_id,
e.entity_id,
0 AS store_id,
1 AS value
FROM `catalog_category_entity` AS e
INNER JOIN
`eav_attribute` AS a
ON a.entity_type_id = e.entity_type_id
AND a.attribute_code = 'm_show_in_layered_navigation'
ON DUPLICATE KEY UPDATE value = 1;