<?php
/*get all category */
$cat_id=array();
$pro_id=array();
$categories = Mage::getModel('catalog/category')->getCollection()
->addAttributeToSelect('id')
->addAttributeToSelect('is_active');
foreach ($categories as $category)
{
if ($category->getIsActive()) {
$entity_id = $category->getId();
array_push($cat_id, $entity_id );//push all category id in a array
}
}
?>
/*get all category */
$cat_id=array();
$pro_id=array();
$categories = Mage::getModel('catalog/category')->getCollection()
->addAttributeToSelect('id')
->addAttributeToSelect('is_active');
foreach ($categories as $category)
{
if ($category->getIsActive()) {
$entity_id = $category->getId();
array_push($cat_id, $entity_id );//push all category id in a array
}
}
?>
No comments:
Post a Comment