I need to get the top menu html is cron job and need to save it in the db. I used the the same functionalities as in the core to get the top menu in my cron job function. But the problem is I need to top menu for each store.

Below is the core function specifying the menu

$this->_menu = new Varien_Data_Tree_Node(array(), 'root', new Varien_Data_Tree());

Is there a way to set the particular store and the respective topmenu html?

1 Answer 1


Yes, you can use environment emulation of the specified store

$appEmulation = Mage::getSingleton('core/app_emulation');

//Start environment emulation of the specified store
$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);

 * Any code thrown here will be executed as we are currently running that store
 * with applied locale, design and similar

//Stop environment emulation and restore original store

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.