Magento get store by storecode

function _getStoreByCode($storeCode)
{
    $stores = array_keys(Mage::app()->getStores());
    foreach ($stores as $id)
    {
        $store = Mage::app()->getStore($id);
        if ($store->getCode() == $storeCode)
        {
            return $store;
        }
    }
    return false;
}

Author: Tahir Yasin

Tahir is a Passionate Web Developer from Lahore, Pakistan and a guy with NEVER-STOP-LEARNING attitude who keeps an eye on emerging technologies and customer trends.

Leave a Reply

Your email address will not be published. Required fields are marked *