Re: Move language selector to header in Dawn Theme

Move language selector to header in Dawn Theme

khouzani
Visitor
1 0 0

Hello everyone

I change my theme to Dawn and add a language to the theme. Now I want to move the language selector from the footer to the header. 

Is there any solution for this?

Https://mehdinaghavi.com

Replies 2 (2)

dmwwebartisan
Shopify Partner
12321 2551 3725

@khouzani 

Please share screenshot what do you want !

Thanks!

If helpful then please Like and Accept Solution | Email: dmw.webartisan@gmail.com |  Instagram: @dmw.webartisan
Check here PageFly App to customize your pages | #1 Product Filter & Search app on Shopify | The most powerful Shopify page builder app

sktch-io
Shopify Partner
7 1 4

You would have to edit the code of the theme to achieve something like that. You need to look into the footer section file of the theme, find the section that generates the language selector and copy it to the header section file.

The code will look something like this:

{% form 'localization' %}
  <select name="country_code">
    {% for country in localization.available_countries %}
      <option value="{{ country.iso_code }}"
        {%- if country == localization.country %} selected="selected"{% endif %}
      >
        {{ country.name }} ({{ country.iso_code }}) - {{ country.currency.symbol }}
      </option>
    {% endfor %}
  </select>

  <input type="submit" value="Update">
{% endform %}

 

Alternatively, if you're just starting out and did not put too much work in customizing the theme yet, you can checkout an app we made called Sktch.io Theme Builder, the sample theme is very similar to the Dawn theme and for customizations like the one you want are done easily by dragging the language form from the footer directly to the header (in the navigator panel).

Sktch.io Theme Builder: Create Shopify themes without writing a single line of code!