0

for design purposes -css customization - I need to echo in my catalog list view the first category. Taking into consideration that the first category is Root (or default) all paths give me that category id number. consequently I need to retrieve the code of the second category starting on root.

example: default category (id=1) - electronics (id =2 )- mp3 players(id=3) - ipod (id=4). when I´m visiting category ipod I would like to echo in my view 2 (for id=2).

I tested this code

$_cat = new Mage_Catalog_Block_Navigation();
getCurrentCategory();
$curent_cat_id = $curent_cat->getId();

load($curent_cat_id)->getParentId();
echo $parentId;

but I´m receiving the first root category. Does anyone knows if I can pass any parameter to retrieve the root category + 1?. brgds!

  • 1
    I'm not sure I understand your question, but in case I did, maybe this answers it, or at least helps you a little. magento.stackexchange.com/questions/4606/… – Marius Jul 8 '13 at 12:08
  • yes, it seems to be that info.. i wil try that solution.. thank you! – s_h Jul 8 '13 at 12:58

Browse other questions tagged or ask your own question.