Configure fields
Create a field
Section titled “Create a field”Admin → CDA Custom Fields → Fields → Add New Field (top-right).
The form has six sections:
- Custom Field — code, label, type, surface, active toggle
- Display & Defaults — placeholder, default value, options for select fields
- Visibility — restrict by store view and customer group
- Show on admin / invoice / customer account — where the value renders
- Product Page Bindings — only for
applies_to = product_page - Advanced — validation rules and conditional show/hide
Custom Field — General settings
Section titled “Custom Field — General settings”| Setting | What it does |
|---|---|
| Code | Lowercase machine name (vat_id). Used in REST/GraphQL responses, in form POST keys (cda_custom_fields[vat_id]), and as the storage key. Must be unique across all fields. |
| Label | What customers see (VAT / Tax ID). Translatable via i18n/en_US.csv. |
| Field Type | See Field types for the full list. |
| Applies To | Which storefront surface renders this field. See Surfaces. |
| Active | Toggle to take the field offline without deleting it. Existing values stay in DB. |
| Required | Adds * to the label, blocks form submit if empty. Server-side enforced. |
| Sort Order | Lower numbers render first within a surface. |
Display & Defaults
Section titled “Display & Defaults”| Setting | Notes |
|---|---|
| Placeholder | Grey ghost text inside the input. Hidden on focus. |
| Default Value | Pre-filled before the customer types. Useful for Title defaulting to Mr. etc. |
| Options | Only for select, multiselect, checkbox, radio. Add as many as you need — value is what’s stored, label is what’s shown. |
Visibility & scoping
Section titled “Visibility & scoping”By default, a new field has no visibility restrictions — it shows on every store view, for every customer group.
To restrict:
- Toggle Restrict visibility on.
- Select one or more Store Views and/or Customer Groups.
- Save.
Display locations
Section titled “Display locations”| Setting | Renders the value on… |
|---|---|
| Show on Admin Order View | Sales → Orders → [order detail] — Custom Fields section |
| Show on Invoice / PDF | Generated PDF invoices and credit memos |
| Show in Customer Account | Customer’s My Orders → [order detail] (storefront) |
All three default to on for a new field. Turn off any that don’t apply.
Product Page bindings
Section titled “Product Page bindings”Only relevant when Applies To = Product detail page. Three binding strategies — combinable:
| Binding | When the field shows |
|---|---|
| Attribute Set | Product’s attribute set matches one of the selected sets |
| Include — Specific Product SKUs | Product’s SKU is in the list, even if its attribute set doesn’t match |
| Exclude — Specific Product SKUs | Product’s SKU is in the list — field is SUPPRESSED even if attribute set / include would match |
Resolved as: (attribute_set match OR include match) AND NOT exclude match.
Advanced — Validation & Conditional Logic
Section titled “Advanced — Validation & Conditional Logic”Validation Rules (JSON)
Section titled “Validation Rules (JSON)”Optional JSON object that adds front-end validation. Example:
{ "min_length": 3, "max_length": 50, "regex": "^[A-Z0-9]+$"}The form-element validator runs these on submit. Server-side, the value is also stored within the field-type’s natural limits (varchar 64KB for text/select, text for textarea).
Conditional Logic
Section titled “Conditional Logic”Hide a field unless rules match against other fields’ values. From the Advanced section, click Add Rule to add:
Show this field when [field_code] [operator] [value]Operators:
| Operator | Matches |
|---|---|
equals | Exact value |
not_equals | Anything except this value |
empty | Field has no value |
not_empty | Field has any value |
contains | Substring match (also works on multiselect arrays) |
Multiple rules are ANDed. For OR logic, create separate fields with different rule sets — Magento’s UI doesn’t let us nest the rule tree any further.
Field types
Section titled “Field types”See the dedicated Field types reference.
Templates and presets
Section titled “Templates and presets”To skip filling the form by hand:
- Quick Add — Single Field Presets (Templates page) — click any preset to open the New Field form pre-populated with code, label, type, options, placeholder, and
applies_to. Edit if needed, then Save. - Use Case Templates (Templates page) — create a whole set of related fields in one click (Birthday Gift, B2B Wholesale, Engraving, etc.).
See Templates & presets for the full catalog.