Handle validation errors

Created on 19 August 2024, 5 months ago

Problem/Motivation

Using ajax disables client side form validation, so we had the problem that certain validations we have in place (like a maximum quantity you can order certain items) wasn't handled properly.

The ajax callback kind of checks for validation errors, but all it does is then not update the cart, but it still displays a success message.

Steps to reproduce

Proposed resolution

Check for errors, if so, return only those and no success message.

We also combined with with disabling IEF in custom code, because that doesn't much make sense, if you'd want to support that you'd also need to re-render and replace the whole form.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

🇨🇭Switzerland berdir Switzerland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @berdir
  • Status changed to Closed: duplicate 5 months ago
  • 🇨🇭Switzerland berdir Switzerland

    I was using an old version (because we were stuck on an old commerce version), looks like that's already improved.

Production build 0.71.5 2024