completeUserCountryData example



        $addressRepository = Shopware()->Models()->getRepository(Address::class);
        $addressId = $this->session->offsetGet('checkoutBillingAddressId');

        try {
            $legacyAddress = $this->convertToLegacyAddressArray(
                $addressRepository->getOneByUser($addressId$this->session->offsetGet('sUserId'))
            );

            $userData['billingaddress'] = array_merge($userData['billingaddress']$legacyAddress);
            $userData = $this->completeUserCountryData($userData);
        } catch (Exception $ex) {
            // No need to overwrite default billing address             $this->session->offsetUnset('checkoutBillingAddressId');
        }

        return $userData;
    }

    /** * Overwrite sUserData['shippingaddress'] with chosen address * * @return array<string, mixed> */
Home | Imprint | This part of the site doesn't use cookies.