Shopify themes, liquid, logos, and UX
Hello there!
I can't output error messages in "Customer login form".
The fields are not colored. And no error messages is displayed under the fields.
Content of the file "login.liquid":
<div>
<h4 id="LoginHeading" class="text-center mb-3">{{ 'customer.login.title' | t }}</h4>
{%- assign formId = 'CustomerLoginForm' -%}
{% form 'customer_login', id: formId, novalidate: 'novalidate', class: 'd-flex flex-column vertical-form' %}
{% include 'form-status', form: form, form_id: formId %}
<input
type="email"
name="customer[email]"
id="{{ formId }}-email"
class="input mb-1{% if form.errors contains 'email' %} input--error{% endif %}"
{% if form.email %} value="{{ form.email }}" {% endif %}
autocorrect="off"
autocapitalize="off"
autocomplete="email"
aria-required="true"
{%- if form.errors contains 'email' -%} aria-invalid="true" aria-describedby="{{ formId }}-email-error" {%- endif -%}
placeholder="{{ 'customer.login.email' | t }}"
>
{%- if form.errors contains 'email' -%}
<span id="{{ formId }}-email-error" class="input-error-message">
<span class="visually-hidden">{{ 'general.accessibility.error' | t }}</span>
{% include 'icon-error' %}
<span>{{ form.errors.translated_fields['email'] | capitalize }} {{ form.errors.messages['email'] }}.</span>
</span>
{%- endif -%}
{% if form.password_needed %}
<input
type="password"
value=""
name="customer[password]"
id="{{ formId }}-password"
class="input mb-1{% if form.errors contains 'password' %} input--error{% endif %}"
aria-required="true"
{%- if form.errors contains 'password' -%} aria-invalid="true" aria-describedby="{{ formId }}-password-error" {%- endif -%}
placeholder="{{ 'customer.login.password' | t }}"
>
{% endif %}
{%- if form.errors contains 'password' -%}
<span id="{{ formId }}-password-error" class="input-error-message">
{% include 'icon-error' %}
<span>{{ form.errors.translated_fields['password'] | capitalize }} {{ form.errors.messages['password'] }}.</span>
</span>
{%- endif -%}
<div class="text-center mt-2">
<input type="submit" value="{{ 'customer.login.sign_in' | t }}" class="button w-button mb-075">
<p>{{ 'layout.customer.create_account' | t | customer_register_link }}</p>
{% if form.password_needed %}
<p><a href="#recover" id="RecoverPassword">{{ 'customer.login.forgot_password' | t }}</a></p>
{% endif %}
</div>
{% endform %}
</div>
This check works correctly in the "register.liquid" file.
What am I doing wrong? I would be grateful for any help. Thanks!
Hi @Svyatoslav,
Did you ever find a resolution for this? Seems like many people (including myself) have struggled with this, however I have never seen a definitive answer.
Thanks in advance,
Oliver.
Hey! I haven't yet found a solution to the problem. I left everything as it is.
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024