Permalink
Browse files

Merge pull request #3 from obukhow/master

Fix 'default' store code issue
  • Loading branch information...
2 parents ec1b46c + 4d7045d commit 5ce98c4300f60fda2a70eb866e84f0bba93d16ab @hws47a committed Sep 10, 2015
Showing with 4 additions and 2 deletions.
  1. +4 −2 app/code/local/VF/CustomMenu/Model/Attribute.php
@@ -41,10 +41,12 @@ public function getSourceAttributes()
{
$values = array(array('label' => '', 'value' => ''));
/** @var $layer Mage_Catalog_Model_Layer */
- Mage::app()->setCurrentStore(Mage_Core_Model_Store::DEFAULT_CODE);
+ $appEmulation = Mage::getSingleton('core/app_emulation');
+ $defaultFrontendStore = Mage::app()->getDefaultStoreView();
+ $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($defaultFrontendStore->getId());
$layer = Mage::getModel('catalog/layer');
$attributes = $layer->getFilterableAttributes();
- Mage::app()->setCurrentStore(Mage_Core_Model_Store::ADMIN_CODE);
+ $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
foreach ($attributes as $_attribute) {
$values[$_attribute->getAttributeCode()] = array(
'label' => $_attribute->getFrontendLabel(),

0 comments on commit 5ce98c4

Please sign in to comment.