For update all categories with attribute is_anchor to 1

<?php

require_once 'app/Mage.php';
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

ini_set('display_errors', 1);
ini_set('max_execution_time', 600);

$categories = Mage::getModel('catalog/category')->getCollection();

foreach ($categories as $cat){

   $_cat = Mage::getModel('catalog/category')->load($cat->getId());

   if ($_cat->getData('is_anchor') == 0){
      $_cat->setData('is_anchor',1);
      $_cat->save();
   }

   echo $_cat->getName().' '.$_cat->getData('is_anchor').'<br/>';
}

Leave a Reply

Your email address will not be published. Required fields are marked *