Skip to content

Commit

Permalink
Merge pull request #3 from obukhow/master
Browse files Browse the repository at this point in the history
Fix 'default' store code issue
  • Loading branch information
hws47a committed Sep 10, 2015
2 parents ec1b46c + 4d7045d commit 5ce98c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/code/local/VF/CustomMenu/Model/Attribute.php
Expand Up @@ -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(),
Expand Down

0 comments on commit 5ce98c4

Please sign in to comment.