Skip to content

Commit

Permalink
Use specified store on product preview page.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeykalenyuk committed Sep 26, 2014
1 parent 50fc949 commit 1373be3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public function preDispatch()
public function previewAction()
{
// Get initial data from request
$defaultStoreViewId = ($storeView = Mage::app()->getDefaultStoreView()) ? $storeView->getId() : null;
$storeId = (int) $this->getRequest()->getParam('store_id', $defaultStoreViewId);
$categoryId = (int) $this->getRequest()->getParam('category', false);
$productId = (int) $this->getRequest()->getParam('id');
$specifyOptions = $this->getRequest()->getParam('options');
Expand All @@ -57,6 +59,8 @@ public function previewAction()
$params->setSpecifyOptions($specifyOptions);

// Render page
$appEmulation = Mage::getSingleton('core/app_emulation');
$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
try {
$viewHelper->prepareAndRender($productId, $this, $params);
} catch (Exception $e) {
Expand All @@ -71,5 +75,6 @@ public function previewAction()
$this->_forward('noRoute');
}
}
$appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
}
}

0 comments on commit 1373be3

Please sign in to comment.