I want to change store by location in magento. For that I create a popup of location dropdown when user open website in there browser, here user selects its location and website redirect to particular store.
public function getLocationInfoByIp($observer) {
$location = $_POST['location'];
switch ($location) {
case "US": {
Mage::app()->setCurrentStore('en');
break;
}
case "IN": {
Mage::app()->setCurrentStore('de');
break;
}
default: {
Mage::app()->setCurrentStore('en');
break;
}
}
}
When I submit popup after selecting location from dropdown, It change store. But after refresh it again change store to default.
So please suggest to resolve this issue.