Skip to content

Instantly share code, notes, and snippets.

@ifnull
Last active August 29, 2015 14:13
Show Gist options
  • Save ifnull/57c631c8791720270b04 to your computer and use it in GitHub Desktop.
Save ifnull/57c631c8791720270b04 to your computer and use it in GitHub Desktop.
Add multi store support to Magento MegaMenu.
// File: /app/design/adminhtml/default/default/template/mgs_megamenu/category.phtml
// append at line #3 directly after the "$category = Mage::getModel[...]" line.
// HACK: Allow us to use root categories not part of default store
$mmId = $this->getRequest()->getParam('id');
if ($mmId){
// Use the first selected store ... hopefully this won't be a problem.
// We should be creating seperate menus for each store anyway. But this
// could be an issue when we get into localization.
$mmStoreId = current(Mage::getModel('megamenu/megamenu')->load($mmId)->getStoreId());
if($mmStoreId !== 0) {
// Override category
$category = Mage::getModel('catalog/category')->load(Mage::app()->getStore($mmStoreId)->getRootCategoryId());
}
}
...
@ifnull
Copy link
Author

ifnull commented Jan 16, 2015

The problem with this solution is that is requires you to save first before selecting category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment