Aug 212012
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')
 ->addAttributeToFilter('is_anchor', 0)
 ->addAttributeToFilter('entity_id', array("gt" => 1))

foreach($categories as $category) {
 echo $category->getId() . "\t" . $category->getName() . "\n";

  One Response to “How i can set Is Anchor to all changeories in magento by php script?”

  1. thanks. just what I was looking for

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>