$collection = Mage::getResourceModel('catalog/category_collection')
->addAttributeToSelect('entity_id')
->addAttributeToSelect('name')
->addAttributeToSort('position', 'desc')
->load();
$x=1;$ids=NULL;
foreach ($collection as $c){
if($c->getData("entity_id")>2 && $x=1)
{
$ids=$c->getData("entity_id"); $x=0;
}
}
$cat = Mage::getModel("catalog/category");
$cat->load($ids);
$FrontCategories["category"]["src_1"]=$cat->getImageUrl();
$FrontCategories["category"]["name_1"]=$cat->getName();
$FrontCategories["category"]["href_1"]=$cat->getUrl();
$this->FrontContegryID=$ids;
return $FrontCategories;
** you need to modify this code by needs
Comments
Post a Comment