Aero has address forms in the checkout, account-area, and admin that can be extended.
Storefront Address Forms
The storefront address forms are address forms found on your storefront (the checkout and the account-area). These forms are customer facing and all extend Aero\Forms\AddressForm
.
Structure
In all of the address forms there’s a top_sections
, sections
, and bottom_sections
section (some forms have an additional section). These sections build up the form. The reason that there are sections is so when the form is in lookup mode, the address fields can be hidden as they’re all in the sections
section.
Top Sections
Key |
View |
first_name |
forms::address.fields.first-name |
last_name |
forms::address.fields.last-name |
lookup |
forms::address.lookup |
Sections
Key |
View |
company |
forms::address.fields.company |
line1 |
forms::address.fields.line1 |
line2 |
forms::address.fields.line2 |
city |
forms::address.fields.city |
zone |
forms::address.fields.zone |
postcode |
forms::address.fields.postcode |
country |
forms::address.fields.country |
Bottom Sections
Key |
View |
phone |
forms::address.fields.phone |
Additional Sections
Some storefront address forms have some additional sections on top of the ones above. To adjust these sections you’d have to specifically extend the specific form class instead of the generic Aero\Forms\AddressForm class.
Aero\Checkout\Http\Forms\CustomerAddressForm
This address form has additional customer sections.
Key |
View |
customer |
account-area::forms.fields.address.name |
Aero\AccountArea\Http\Forms\AccountAddressForm
This address form is extended by all of the other account area address forms. This form injects 2 additional things to the top and bottom sections.
The top sections has this injected right at the top of all of the top sections:
Key |
View |
address_name |
checkout::sections.customer |
The bottom sections has this injected right at the bottom of all of the bottom sections:
Key |
View |
is_default |
account-area::forms.fields.address.is_default |
Admin Address Forms
The admin address forms are address forms found on your admin. These forms all extend Aero\Admin\Http\Forms\AdminAddressForm.
Structure
The structure for the admin forms is the same as the structure for the storefront forms but the views are different.
Top Sections
Key |
View |
first_name |
admin::forms.fields.address.first-name |
last_name |
admin::forms.fields.address.last-name |
lookup |
admin::forms.partials.address-lookup |
Sections
Key |
View |
company |
admin::forms.fields.address.company |
line1 |
admin::forms.fields.address.line1 |
line2 |
admin::forms.fields.address.line2 |
city |
admin::forms.fields.address.city |
zone |
admin::forms.fields.address.zone |
postcode |
admin::forms.fields.address.postcode |
country |
admin::forms.fields.address.country |
Bottom Sections
Key |
View |
phone |
admin::forms.fields.address.phone |
Address Form Validation
All address forms take validation from Aero\Forms\Validation\AddressRules. Instead of adding rules to this class through the extends static method you should make use of the Aero\Common\Helpers\Address::addField() method. This method accepts the same parameters as if you were extending a validator (you can learn more about that here, link). The difference is that it adds the rules but also makes your field fillable on all of the address models. These models are Aero\Account\Models\Address, Aero\Cart\Models\OrderAddress, and Aero\Fulfillment\Models\FulfillmentAddress.