Skip to content

Instantly share code, notes, and snippets.

View jonazu's full-sized avatar

Jonas Zumkehr jonazu

View GitHub Profile
foreach (Mage::app()->getWebsites() as $website) {
foreach ($website->getGroups() as $group) {
$stores = $group->getStores();
foreach ($stores as $store) {
echo '<link rel="alternate" href="' . $store->getCurrentUrl() . '" hreflang="' . $store->getConfig('general/locale/code') . '"/>' . "\n";
}
}
}
@jonazu
jonazu / magento-urls.php
Last active July 18, 2016 14:44
Magento URLs
Mage::app()->getStore()
/* Store Id */
Mage::app()->getStore()->getStoreId()
/* Store Name */
Mage::app()->getStore()->getName()
/* Store Code */
Mage::app()->getStore()->getCode()