Skip to content

Instantly share code, notes, and snippets.

@petarBozovic
Created December 22, 2017 20:25
Show Gist options
  • Save petarBozovic/3b01783031c27e91b2b7a7ab05e7de26 to your computer and use it in GitHub Desktop.
Save petarBozovic/3b01783031c27e91b2b7a7ab05e7de26 to your computer and use it in GitHub Desktop.
Get all stores in a Magento 1
<?php
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
//Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$allStores = Mage::app()->getStores();
foreach ($allStores as $_eachStoreId => $val)
{
$_storeCode = Mage::app()->getStore($_eachStoreId)->getCode();
$_storeName = Mage::app()->getStore($_eachStoreId)->getName();
$_storeId = Mage::app()->getStore($_eachStoreId)->getId();
echo $_storeId;
echo '<br>';
echo $_storeCode;
echo '<br>';
echo $_storeName;
echo '<br>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment