Last active
September 28, 2015 18:20
-
-
Save paulmouzas/847fe3a850e21bb9d43e to your computer and use it in GitHub Desktop.
update_categories.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'app/Mage.php'; | |
Mage::app(); | |
$category = Mage::getModel('catalog/category'); | |
$tree = $category->getTreeModel(); | |
$tree->load(); | |
$ids = $tree->getCollection()->getAllIds(); | |
if ($ids){ | |
foreach ($ids as $id){ | |
$cat = Mage::getModel('catalog/category'); | |
$cat->load($id); | |
$entity_id = $cat->getId(); | |
$name = $cat->getName(); | |
$url_key = $cat->getUrlKey(); | |
$url_path = $cat->getUrlPath(); | |
$level = $cat->getLevel(); | |
echo $entity_id . ": " . $name . "-> " . $level . "\n"; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment