I am trying to set category Is Anchor default to yes for all categories I tried these database queries
UPDATE catalog_category_entity_int set value = 1 where attribute_id = 51;
query run successfully but no effect in categories
try this
UPDATE `catalog_category_int` set value = 1 where attribute_id = 51 and parent_id <> 0
return error
error:#1146 - Table 'magento1.catalog_category_int' doesn't exist
and try with this create new file in magento root directory with this code
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
// Load Up Magento Core
define('MAGENTO', realpath(''));
require_once(MAGENTO . '/app/Mage.php');
$app = Mage::app();
$categories = Mage::getModel('catalog/category')
->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('is_anchor', 0)
->addAttributeToFilter('entity_id', array("gt" => 1))
->setOrder('entity_id')
;
foreach($categories as $category) {
echo $category->getId() . "\t" . $category->getName() . "\n";
$category->setIsAnchor(1);
$category->save();
}
but no result Thanks in advance for help