d
Topic
Jason7 Member
Posts:
102
January 16, 2014

{{ form.errors | default_errors }} - where do I find them? This post is outdated

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

i
Replies
Mark Shopify Partner appchamps.com
Posts:
19
January 16, 2014

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. 

Jason7 Member
Posts:
102
January 16, 2014

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?

Mark Shopify Partner appchamps.com
Posts:
19
January 16, 2014

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.

Jason7 Member
Posts:
102
January 16, 2014

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! :)

Jason Shopify Expert freakdesign.com.au
Posts:
9249
January 16, 2014

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