How can I improve language selection function for my online store's subdomains?

I designed a simple menu through which I can go to the appropriate subdomain on the store. However, I would like to improve them and add some functionality.

When the link is selected, you are not redirected to the main page of a given language, but to the page you are currently visiting.

The customer enters the products page and wants to change the language, after clicking on the language change link, he is redirected to the product page, not to the home page.

Shop available, menu with language selection in the lower left corner of the page:
https://medpak.shop

Hi @kazunarii ,

Please send me the code of theme.liquid file, I will check it for you

This is the code I use.

{% form 'localization', id: "localization_form_tag", class: "dropup" %}

  {% for locale in shop.published_locales %}
  {{ locale.endonym_name }}
  [German](https://de.medpak.shop)
  [Czech](https://cz.medpak.shop)
  [Slovak](https://sk.medpak.shop)
  [English](https://medpak.shop)
  {% endfor %}
  

  {% endform %}

Hi @kazunarii ,

Please change all code:

{% form 'localization', id: "localization_form_tag", class: "dropup" %}

  {% for locale in shop.published_locales %}
  [{{ locale.endonym_name }}](https://medpak.shop{{ request.path }})
  [German](https://de.medpak.shop{{ request.path }})
  [Czech](https://cz.medpak.shop{{ request.path }})
  [Slovak](https://sk.medpak.shop{{ request.path }})
  [English](https://medpak.shop{{ request.path }})
  {% endfor %}
  

{% endform %}
1 Like