I don’t understand how works the address field key under the file shipping-address-fields.twig
Indeed, the default template using address-shipping-address1 and address-shipping-address2 where the MODX user form contain only one address field
I’m trying to retrieve the address field from my user account during the checkout address step but it don’t want !
What is the correct way to retrieve it (and eventually update it if changed after form validation) ?
Enable the UserProfileAddress module, that will retrieve, set and update the user address in the right place in Commerce. No need to make any template changes at all.
The UserProfileAddress module already accounts for that; the address user field is split up by line breaks (\n) and assigned to address1, address2 and address3 fields in Commerce automatically.
Same in the reverse direction when choosing to update the address on the profile, address1-3 are combined with a linebreak and stored to the user profile address.