<?php foreach (Mage::app()->getWebsites() as $website) {
foreach ($website->getGroups() as $group) {
$stores = $group->getStores();
foreach ($stores as $store) {
$storeCode = $store->getCode();
echo '<link rel="alternate" hreflang="' . $storeCode . '" href="' . $store->getCurrentUrl(false) . '"/>' . "\n";
}
} } ?>
This produces, for example,
<link rel="alternate" hreflang="en_ca" href="http://mywebsite.com/en/?___store=en_ca">
But I want to remove ?___store=en_ca
part.
I tried replacing:
$this->_href = $this->_href . $symbol . "___store=" . $store->getCode();
into:
$this->_href = $this->_href;
in app/code/core/Mage/Catalog/Block/Widget/Link.php
But didn't work.
How can I achieve this?