I added some custom fields for address for in a twig template which extends from
@Storefront/storefront/component/address/address-form.html.twig
when i submit the form from the /checkout/register page, the custom fields are not saved.
In the Shopware\Core\Checkout\Customer\SalesChannel\RegisterRoute.php file, when data mapping is done for address, only the fields below are mapped:
private function mapAddressData(DataBag $addressData): array
{
$mappedData = $addressData->only(
'firstName',
'lastName',
'salutationId',
'street',
'zipcode',
'city',
'company',
'department',
'countryStateId',
'countryId',
'additionalAddressLine1',
'additionalAddressLine2',
'phoneNumber'
);
if (isset($mappedData['countryStateId']) && $mappedData['countryStateId'] === '') {
$mappedData['countryStateId'] = null;
}
return $mappedData;
}
How can i save custom fields for an address when developing an app? is it possible ?