Skip to main content

Posts

Showing posts from June, 2018

Prestashop Add canonical and hreflang for multi-language website

The cannonical and hreflang tags are useful if our store is multi-language. It avoids duplication of url for each store and helps the site SEO by mentioning the url of different languages. This will indicate to the google crawlers which is the alternative link for each languages and / or geographical areas where the online store and the canonical url of the product are available, category, manufacturer list, which in many cases will be very useful. We can add the cannonical and hreflang tags on prestashop at the header.tpl template file. The template files are under theme/yourthemename folder. The following code needs to be added inside the head section: { if $ page_name == 'category' } <link rel = "canonical" href = "{$ link-> getCategoryLink ($ smarty.get.id_category, null, $ id_lang, null, null)}" />  { if $ languages | @ count > 1 } { foreach $ languages as $ lang } <link rel = "alternate" hreflang = "{$ lang.iso_