Adding a field to an existing SFRA form through a custom cartridge
Key Takeaway
Make every change in a custom cartridge to the left of app_storefront_base, and save submitted form data in a route:BeforeComplete handler.
An SFRA storefront form has three parts. A form definition is an XML file that lists the fields and their validation rules. A controller turns that definition into a JSON form object. An ISML template then renders the form object. To add a field to a form that ships in app_storefront_base, you make every change in your own custom cartridge and never edit the base cartridge. Leaving the base cartridge untouched means you can still take SFRA security updates, bug fixes and new features.
Working in a custom cartridge
Do not edit app_storefront_base or the server module. Editing them voids the backward-compatibility guarantee and makes it harder to adopt fixes.
Instead, put your customizations in a custom cartridge. Place the custom cartridge to the left of app_storefront_base on the cartridge path. You configure the cartridge path in Business Manager.
The platform searches the cartridge path from left to right and uses the first matching controller or template. Because of that search order, a cartridge earlier on the path can override one later on the path.