- Issue created by @rszrama
- 🇮🇱Israel jsacksick
Actually, disabling the profile copying would have to be done from Commerce shipping itself, since it is the one adding that checkbox, via the following code:
/** * Implements hook_commerce_inline_form_PLUGIN_ID_alter(). */ function commerce_shipping_commerce_inline_form_customer_profile_alter(array &$inline_form, FormStateInterface $form_state, array &$complete_form) { // Attach the "Billing same as shipping" element. $profile_field_copy = \Drupal::service('commerce_shipping.profile_field_copy'); if ($profile_field_copy->supportsForm($inline_form, $form_state)) { $profile_field_copy->alterForm($inline_form, $form_state); } }We'd probably need to alter the
supportsForm()method to check if the form is the order edit form. - 🇺🇸United States rszrama
Ahh, thanks! I didn't look too deeply into where the checkbox came from. I'm going to relate this one to another shipping UX improvement I proposed for the order edit form, too.