Profile Comments/Notes

I’m looking to retrieve and store data in the Profile Comments field using the User Profile Address module.

In the mod_commerce_address table it looks like this field is called “notes”, however in the shipping-address-fields.twig template I can’t figure out what the placeholder should be, I’ve tried: {{ address_shipping_notes }} and a few others.

I’ve also noticed in the default setup if the “Save this address on my profile” is checked then whatever is already in the Comments filed on the profile is erased.

The address_{type}_{field} placeholders contain what the customer entered/selected, so those may be empty if there’s not already provided. Those would be used in the inputs as the value and should be notes. Internally, Commerce is mapping that to the comment field on the user profile.

This should work:

    <div class="c-field {% if error_shipping_notes %}error{% endif %}">
        <label for="address-shipping-notes">{{ lex('commerce.address.notes') }}</label>
        <input type="text" name="address[shipping][notes]" id="address-shipping-notes" value="{{ address_shipping_notes }}">
        {% if error_shipping_notes %}<span class="c-field-error">{{ error_shipping_notes }}</span>{% endif %}