Jump to content
thirty bees forum

Main logo link to correct language


rubben1985

Recommended Posts

Hi everyone,

Using semrush (seo tool) to male a SEO audit, it indicates me that most of the urls of my multilingual stores have one common mistake that is creating extra innecessary redirections (that hurts SEO as it difficult crawl).

The fault is from the main logo in multilingual environment because instead of linking the correct homepage version (domain/language/) is linking the main directory (domain/).

Example:

www.shop.com/en/

Imagein we are in www.shop.com/es/product1. The logo has the link "www.shop.com". When you clic on it, it goes to www.shop.com and later automatically redirects to www.shop.com/en/ instead of going directly to www.shop.com/es/ so there is an innecesary redirect.

If the logo would redirect to the same version, it would help a little the SEO of every TB store.

Is this something simple to do?

 

In PS forum they did something similar with the logo image (change the image according to the language). i suppose that cod could be similar but being used to adapt the link to the language

https://www.prestashop.com/forums/topic/46690-solvedhow-to-change-homepage-logo-refering-to-language/

 

I think this is an improvement that could be also good to implemented in the core.

Any ideas?

 

Edited by rubben1985
Link to comment
Share on other sites

well, I made some research and "empiric" try and error and I am closer but not Idea how to continue.

In /theme/header.tpl

 

I have change the line making reference to the logo link from:

href="{$base_dir_ssl}"

to

href="{$base_dir_ssl}{$lang_iso}/"

 

This works in shops with languages, but not in those with only one because it adds the language without needing it.

 

My case is: I have a multistore.

STORE 1: lesielle.com/int/ with a few languages-> lesielle.com/int/es/ , lesielle.com/int/en/, lesielle.com/int/de/...

STORE 2: lesielle.com/es/ has only one language. (IMP: The /es/ does not make reference to the language, is just the subdirectory where the store is located. the same as the "int" in the store 1)

 

With the modification I made. It works perfect in STORE 1  because it ads the language to the main directory.

But in STORE 2, doesn't because it ads the language when it is not needed it and the link that creates is lesielle.com/es/es/

 

Any idea what code to use to only ad the /language/ when the store has more than one language?

I suppose it is something similar of what TB is already doing when creating the home page url (only adding the language subdirectory one it is a multilanguage store)

EDIT: if that would not be easy, and alternative would be to apply "my modification" to only certain ID stores. This would serve me, but would not be good to implement as core functionality as would need manual adjustment.

Edited by rubben1985
Link to comment
Share on other sites

14 hours ago, datakick said:

Try this


<a href="{$link->getPageLink('index')|escape:'html':'UTF-8'}" title="{$shop_name|escape:'html':'UTF-8'}">
...
</a>

 

It works!

I would suggest that you include this in future TB versions. I do not see any cons, but only advantages for search engines and health site puntuations

Link to comment
Share on other sites

1 hour ago, rubben1985 said:

It works!

I would suggest that you include this in future TB versions. I do not see any cons, but only advantages for search engines and health site puntuations

I agree, this will be included in niara

  • Like 2
  • Thanks 1
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...