Wednesday, 21 August 2013

Magento get store list from all websites


$allWebsites = Mage::app()->getWebsites();
<select id="store" name="stire" onChange="">
<?php
foreach ($allWebsites as $website) {
foreach ($website->getGroups() as $group) {
$stores = $group->getStores();
foreach($stores as $_eachStoreId => $val)
{
$_storeCode = Mage::app()->getStore($_eachStoreId)->getCode();
$_storeName = Mage::app()->getStore($_eachStoreId)->getName();
$_storeId = Mage::app()->getStore($_eachStoreId)->getId();
$webid = $website->getId();
?>
<option value="<?php echo $webid; ?>"><?php echo $_storeName;?></option>
<?php
}
}
}
?>
</select>








No comments:

Post a Comment

Thanks for your comments.