Instantly share code, notes, and snippets.

What would you like to do?
// Get the old store
$oldStore = Mage::app()->getStore(true);
// Set the new store
/* @var $customer Mage_Customer_Model_Customer */
$newStore = Mage::app()->getStore($customer->getStoreId());
// Here my code... Am I really on the new store?
// Set the old store
// Start emulation
/* @var $customer Mage_Customer_Model_Customer */
/* @var $emulator Mage_Core_Model_App_Emulation */
$emulator = Mage::getModel('core/app_emulation');
$initial = $emulator->startEnvironmentEmulation($customer->getStoreId());
// Here my code... Yes! I'm really on the new store!
// Stop emulation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment