Add hreflang support to ISC

NOT RECOMMENDED due to the ? character in URL (?setCurrencyId=x) which is not good for Canonical Links


If you have multiple versions of a page for different languages or regions, tell Google about these different variations. Doing so will help Google Search point users to the most appropriate version of your page by language or region.

First of all, if you have a version of a page that you have optimized for the users’ language and location, you want them to land on that page. Having the right language and location dependent information improves their user experience and thus leads to fewer people bouncing back to the search results. Fewer people bouncing back to the search results leads to higher rankings.

The second reason is that hreflang prevents the problem of duplicate content. If you have the same content in English on different URLs aimed at the UK, the US, and Australia, the difference on these pages might be as small as a change in prices and currency. Without hreflang, Google might not understand what you’re trying to do and see it as duplicate content. With hreflang, you make it very clear to the search engine that it’s (almost) the same content, just optimized for different people.

We are using multiple currency display function, so we want to add ‘hreflang‘ tags to all product pages and canonical links should include the current selected currency


In /includes/classes/class.product.php




// MOD

if($GLOBALS['CurrentCurrency'] > 1){
// MOD




(Adjust setCurrencyId=x based on the actual currency setting)

// MOD 
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."\" hreflang=\"x-default\">";
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."\" hreflang=\"en\">";
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."\" hreflang=\"en-us\">";
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."?setCurrencyId=2\" hreflang=\"en-au\">";
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."?setCurrencyId=4\" hreflang=\"en-ca\">";
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."?setCurrencyId=6\" hreflang=\"en-gb\">";
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."?setCurrencyId=5\" hreflang=\"en-fr\">";
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."?setCurrencyId=5\" hreflang=\"en-de\">";
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."?setCurrencyId=5\" hreflang=\"en-it\">";
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."?setCurrencyId=8\" hreflang=\"en-jp\">";
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."?setCurrencyId=10\" hreflang=\"en-ru\">";
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."?setCurrencyId=11\" hreflang=\"en-kr\">";
$GLOBALS['AdditionalMetaTags'] .= "<link rel=\"alternate\" href=\"".ProdLink($this->_prodname)."?setCurrencyId=9\" hreflang=\"en-sg\">";
// MOD 



<link rel="alternate" href="" hreflang="x-default">
<link rel="alternate" href="" hreflang="en">
<link rel="alternate" href="" hreflang="en-us">
<link rel="alternate" href="" hreflang="en-au">
<link rel="alternate" href="" hreflang="en-ca">
<link rel="alternate" href="" hreflang="en-gb">
<link rel="alternate" href="" hreflang="en-fr">
<link rel="alternate" href="" hreflang="en-de">
<link rel="alternate" href="" hreflang="en-it">
<link rel="alternate" href="" hreflang="en-jp">
<link rel="alternate" href="" hreflang="en-ru">
<link rel='canonical' href='' />


Confirm all tags are correct using below tools:

Leave a Reply

Your email address will not be published. Required fields are marked *