I'm trying to work out how to detect when a user has left a store view and landed on another.
Basically I have website A with a domain of
magento.com.localhost and website B with a domain of
On each website I have a store switcher. So if I'm on website A I have a link that looks like
magento.co.uk.localhost/category?___store=gb&___from_store=us and when I click it I go to a different store view, but want to be able to track when this happens.
I figured the easiest way to do this is to use
Mage::app()->getRequest() to get
$_GET['from_store'] but this variable doesn't seem to exist due to the nature of the url rewrites.
Is there a Magento specific way to detect when a user has landed on the site from a different store code and how can I access that store code.
Many thanks in advance.