{{ form.errors | default_errors }} - where do I find them?

Highlighted
Explorer
102 0 27

SIMPLE Theme - {{ form.errors | default_errors }}

Where can I find those form errors? I would like to change the text / language.

Any help is appreciated! Thanks! :)

Jason

0 Likes
Shopify Partner
19 0 3

Hi there.

I had this come up previously - and I resorted to something like this: 

{% if form.errors %}
{% for field in form.errors %}
   {% if form.errors.messages[field] contains "Email is invalid." %}
      Show something else...
   {% endif %}
  {% endfor %}
{% endif %}

I actually ended up with several of those if statements to catch and change the text for various error messages. 

0 Likes
Explorer
102 0 27

Thanks for your reply Mark,

isn't it possible to change them directly in any existent file? Or do I really have to use manually coded stuff?

0 Likes
Shopify Partner
19 0 3

Would depend on the theme settings - I would look there first (maybe under "translations"). Otherwise - which form are you attempting to update? If you know which form it is (contact form, customer login, etc.) then we can point you to where to make the updates.

0 Likes
Explorer
102 0 27

Hello Mark!

It's the free SIMPLE theme.

The form I would need to change is (as far as I can see right now) the customer Login-form.

It says "Invalid login credentials."

Also on the Create Customer Account form -

"Email can't be blank.
Password can't be blank."

Again, thanks for your help! :)

0 Likes
Shopify Expert
9965 84 1465

The method Mark suggested is the way to do it. Check for a string in the form.errors field, and if found show your customer message instead. I suspect you'd be looking at editing the template files rather than hunting for Theme Settings.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes