I am using Drupal Commerce 2.x for my e-commerce website. I have installed the Address module which provides functionality for storing, validating and displaying international postal addresses. I've added the field for the address in the user registration form through which I can accept multiple addresses from the user. As per the default checkout flow, the user has to mention his address manually while entering shipping details. So, is there any mechanism where the user can select the address previously set by him? Or I have to rely on customisation to achieve this functionality?
1 Answer
There is a patch in progress to add this feature.
To apply the patch to the most recent version of Commerce (2.1 as of this writing), based on this comment, you can add this to your composer.json
:
"drupal/commerce": {
"reverse profileSelect change to allow PR 760": "https://www.drupal.org/files/issues/2844920-reverse-profileSelect-temp-fix.patch",
"reuse profiles": "https://patch-diff.githubusercontent.com/raw/drupalcommerce/commerce/pull/760.diff",
"reuse profiles enhanced": "https://github.com/fliegen/commerce/commit/57c11175d279fe55db9454b4274608195211aeb8.diff",
"checkbox same as billing": "https://www.drupal.org/files/issues/checkbox-same-as-billing-2852207-69.patch",
}
"drupal/commerce_shipping": {
"profile select enhancement": "https://github.com/fliegen/commerce_shipping/commit/797b5ef351851d60b2cb6c1a55837501c2a036a5.diff",
"profile in shipping method widget fix": "https://www.drupal.org/files/issues/profile-reuse-enhanced-2908683-1.patch",
"auto-recalculate shipping": "https://www.drupal.org/files/issues/commerce_shipping-autorecalculate-2849756-35.patch"
}
You don't need to add the checkbox same as billing
and commerce_shipping
part if you are not collecting a shipping address.