title: Magento: hreflang meta tag with multistore setup
body: <p>We have a multistore setup in Magento - well, a two-store setup:</p>
  
  <ul>
  <li>English for USD transactions and,</li>
  <li>English for CAD transactions</li>
  </ul>
  
  <p>The "en" store goes with the default URL — i.e. domain.com/
  The "en-ca" store is setup as a subfolder — i.e.  domain.com/ca/</p>
  
  <p>The product/category URLs are all the same, they're merely appended at the end of the above store URLs.</p>
  
  <p>We need to add the following tags:</p>
  
  <pre><code>&lt;link rel="alternate" hreflang="en" href="http://domain.com/" /&gt;
  &lt;link rel="alternate" hreflang="en-ca" href="http://domain.com/ca/" /&gt;
  </code></pre>
  
  <p>where the product/category urls are appended to the store domains in the href tag.</p>
  
  <p>For a Product URL:    domain.com/product-name.html   the above tags should become:</p>
  
  <pre><code>&lt;link rel="alternate" hreflang="en" href="http://domain.com/product-name.html" /&gt;
  &lt;link rel="alternate" hreflang="en-ca" href="http://domain.com/ca/product-name.html" /&gt;
  </code></pre>
  
  <p>For a Category url:    domain.com/category1/subcategory2/  the above tags should become:</p>
  
  <pre><code>&lt;link rel="alternate" hreflang="en" href="http://domain.com/category1/subcategory2/" /&gt;
  &lt;link rel="alternate" hreflang="en-ca" href="http://domain.com/ca/category1/subcategory2/" /&gt;
  </code></pre>
  
  <p>What needs to be added to the template header .phtml files in order to get these output correctly for each product or category page, please?</p>