Ján Ambroz Ján Ambroz - 10 months ago 60
PHP Question

How to add link Sitemap in head in Prestashop

In PrestShop, I have 5 languages, so I have also 5 sitemaps like this:


How I can add link for sitemap to
for current front-end language?

It is PrestaShop 1.5.

The right way is doing it in .tpl or in some Controller?

Answer Source

You could do it in header.tpl, but I recommend you that used hookHeader insted. Something like this:

public function hookHeader($params)
    $sitemap_file = '1_' . $this->context->language->iso_code . '_0_sitemap.xml';
    //could work with echo too
    return 'your link here' . $sitemap_file;

Good luck