Question

I'm experiencing this issue with Magento 1.9.1 single store,

probably my database got damaged:

When I edit an existing category or add a new one the option to select if the category is anchored or not is not appearing

enter image description here

I have backups of some days ago but if there is another way to recover that would be better.

In the frontend some categories still have the layered navigation even if in the admin area I can't choose whether to enable it or not.

Was it helpful?

Solution

You can fix it. Basic you need change the frontend_input and default_value columns of in_anchor attribute. There are two ways to do it.

1. Create a module to do it

You can create a extension to create/edit attributes category following this tutorial: http://www.atwix.com/magento/add-category-attribute/

To fix is_anchor attribute, you need this:

$installer->updateAttribute(Mage_Catalog_Model_Category::ENTITY, 'is_anchor', 'frontend_input', 'select'); 
$installer->updateAttribute(Mage_Catalog_Model_Category::ENTITY, 'is_anchor', 'default_value', NULL);

2. Change values direct in database

 UPDATE `DATABASE_HERE`.`eav_attribute` SET `frontend_input`='select', `default_value`='NULL' WHERE `attribute_id`='51';

NOTE: Check attribute_id of is_anchor and replace if necessary (in my case it's 51).

NOTE2: Be careful and do a backup before!!!

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top