How can get store id by locale code right now I have


reverse of this code

Mage::getStoreConfig('general/locale/code', $storeId);

now based on this I want to get store id I could not find possible way. any suggestion?


I think this code will do the trick for you.

 $allStores = Mage::app()->getStores();
 foreach ($allStores as $_eachStoreId):

  echo $storeId;  

There can be same local for multiple store thats why there is no alternative of this.

$defaultStores = Mage::app()->getStores();
foreach ($defaultStores as $_store)
        // you can use break here if want first value only
  echo '<pre>';print_r($storeIds);die;
  • This is same answer to @fmeExtensions – Qaisar Satti Nov 15 '16 at 7:25
  • @QaisarSatti, Yes but he is consider only 1 store for 1 locale. But it may possible multiple store on a same locale. So technically his answer is wrong. – Ashish Jagnani Nov 15 '16 at 7:27
  • after testing both answers worked for me. but i need single store id. thanks for answer. – Qaisar Satti Nov 15 '16 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.