Conditions and limits
Validation rules
Minimum and maximum length, number ranges and steps, the most checkboxes a customer may tick, and file types and sizes.
Note
This is part of Optionline Pro.
Optionline Pro adds limits to fields. The store checks them on the server when the product is added to the cart, and refuses it with a clear message when a value doesn't fit.
| Setting | For | The customer sees |
|---|---|---|
| Length (min, max) | Text, text area | "Engraving needs at least 2 characters." / "Engraving can be at most 12 characters long." |
| Range (min, max, step) | Number, quantity | "Width must be at least 10." / "Width can be at most 200." The browser's number box also keeps to the range and step. |
| Most choices | Checkboxes | "Choose at most 2 options for Extras." |
| File types, Largest file | File upload | "The file for Photo must be one of these types: JPG, PNG." / "The file for Photo is too large. It can be up to 5 MB." |
Leave a setting empty for no limit. Lengths count characters (an accented letter is one character), including spaces.
Checks that come with the types
Some checks need no setting:
- A number must be a number; a quantity a whole number, not negative.
- A date must be a real date.
- A colour must be a colour code such as #1e73be.
- A file must really be of an allowed type, whatever its name says.
- A required field must be filled in, as in Optionline. A conditional field is only required while it shows.
Without Optionline Pro
If Optionline Pro is deactivated, a field with limits is kept but not shown in your shop, rather than accepted without its limits. It's back when Pro is active again.