How to get category using url_key
and parent category_id
?
If category structure is as follows
-Root
--Mobile
---Android
---Windows
---iOs
--Tablet
---Android
---Windows
---iOs
Then using following code if try to load iOs
category using url_key
it load always load root->Mobile->iOS
$category = Mage::getModel('catalog/category')
->setStoreId(Mage::app()->getStore()->getId())
->loadByAttribute('url_key', 'cat_urlkey');
How I can modify code so that, sub category load by url_key
and respective parent category_id
?