createShippingForm example

$billingForm = $this->createBillingForm($data['register']['billing']);

        $errors = [
            'personal' => $this->getFormErrors($customerForm),
            'billing' => $this->getFormErrors($billingForm),
            'shipping' => [],
            'captcha' => [],
        ];

        $shipping = null;
        if ($this->isShippingProvided($data)) {
            $shippingForm = $this->createShippingForm($data['register']['shipping']);
            $shipping = $shippingForm->getData();
            $errors['shipping'] = $this->getFormErrors($shippingForm);
        } else {
            /** @var Address $billing */
            $billing = $billingForm->getData();

            $billingCountry = $billing->getCountry();

            if ($billingCountry === null) {
                throw new RuntimeException('Billing address needs a country');
            }

            
Home | Imprint | This part of the site doesn't use cookies.