Localization Form Doesn't Work

AbuTamim
Tourist
7 0 0

Hi, 

 

I've been trying to implemented exactly what is been recommended in this url: Multiple Currency and Language Selector , however, the provided script doesn't work and always throw an error of undefined variable. 

So, I tried to make some tweaks utilizing the localization form with Radio Inputs and styling them as a button, however, it doesn't work.

The below code is inserted in the header.liquid file:

  
    <!-- Language Selector -->

  <div class="radio-group">
{% form 'localization' %}

  {% for language in localization.available_languages %}
<input type="radio" id="{{ language.iso_code }}" onclick="this.form.submit()" name="selector" value="{{ language.iso_code }}"
 {%- if language == localization.language %} checked {% endif %}
 >
<label for="{{ language.iso_code }}">{{ language.endonym_name }}</label>
{% endfor %}

{% endform %}
  </div>    
    <!-- Language Selector -->

 

Do you have any idea why the above doesn't work as intended? The form got submitted but the language never changed. 

Moreover, why the above link to shopify Dev doesn't work with their provided script.

Thanks,

0 Likes
AbuTamim
Tourist
7 0 0

Hi,

 

It will be great if someone gave me at least some hint, I can work that out. 

 

Thanks, 

Store url: https://www.mryelh.com

0 Likes
AbuTamim
Tourist
7 0 0

Looking forward to some solutions for the above issue.

Thanks.

0 Likes