Created
December 22, 2017 20:25
-
-
Save petarBozovic/3b01783031c27e91b2b7a7ab05e7de26 to your computer and use it in GitHub Desktop.
Get all stores in a Magento 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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