Billing information on the same step as the shipping information not copied

Created on 3 March 2022, almost 3 years ago
Updated 12 July 2024, 6 months ago

In submitForm is used $billing_profile from $inline_form set in alterForm.

  public static function submitForm(array &$inline_form, FormStateInterface $form_state, $complete_form=null) {

    $billing_profile = $inline_form['copy_fields']['#billing_profile'];
    $shipping_profile = self::getShippingProfileFromInlineForm($inline_form);

If billing information is on the same step as the shipping information and billing information is edited, old version is used.

My solution

  public static function submitForm(array &$inline_form, FormStateInterface $form_state, $complete_form=null) {

    $billing_profile = $inline_form['copy_fields']['#billing_profile'];
    if ($form_state->has('billing_profile')) {
      // Shipping information on the same step as the billing information.
      $billing_profile = $form_state->get('billing_profile');
    }
    $shipping_profile = self::getShippingProfileFromInlineForm($inline_form);
πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡ΏCzech Republic Xperd

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024