Jump to content

Problems with hreflang in products with combinations


Recommended Posts

Good day

We have carried out an SEO audit of the site and we are having problems with the products with combinations, as it indicates that they do not have self-referential hreflang tags.

Can you help us solve this?

Thank you

Link to comment
Share on other sites

  • 2 weeks later...

Hi,
Ensure that the getProductLink method is generating the full URL with the correct language code and combination parameters. If your products with combinations have unique URLs, each combination should have its own self-referential hreflang tag.

Now, Inside the product template, you need to ensure that the hreflang tags are properly generated for each language and each combination of the product. Here's how you can add a self-referential hreflang tag:
{foreach from=$languages item=language}
<link rel="alternate" hreflang="{$language.iso_code}" href="{$link->getProductLink($product.id_product, null, null, null, $language.id_lang)}" />
{/foreach}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...