private function reApplyOrderAddresses($cart, $user)
    {
        // validate addresses
        $this->validateOrCreateAddresses($cart, $user);

        // reapply invoice address of cart
        if ($cart->getInvoiceAddress()->getContactAddress()) {
            $this->orderAddressManager->getAndSetOrderAddressByContactAddress(
                $cart->getInvoiceAddress()->getContactAddress(),
                null,
                null,
                $cart->getInvoiceAddress()
            );
        }

        // reapply delivery address of cart
        if ($cart->getDeliveryAddress()->getContactAddress()) {
            $this->orderAddressManager->getAndSetOrderAddressByContactAddress(
                $cart->getDeliveryAddress()->getContactAddress(),
                null,
                null,
                $cart->getDeliveryAddress()
            );
        }

        // reapply delivery-addresses of every item
        foreach ($cart->getItems() as $item) {
            if ($item->getDeliveryAddress() &&
                $item->getDeliveryAddress()->getContactAddress()
            ) {
                $this->orderAddressManager->getAndSetOrderAddressByContactAddress(
                    $item->getDeliveryAddress()->getContactAddress(),
                    null,
                    null,
                    $item->getDeliveryAddress()
                );
            }
        }
    }
private function reApplyOrderAddresses($cart, $user)
    {
        // validate addresses
        $this->validateOrCreateAddresses($cart, $user);

        // reapply invoice address of cart
        if ($cart->getInvoiceAddress()->getContactAddress()) {
            $this->orderAddressManager->getAndSetOrderAddressByContactAddress(
                $cart->getInvoiceAddress()->getContactAddress(),
                null,
                null,
                $cart->getInvoiceAddress()
            );
        }

        // reapply delivery address of cart
        if ($cart->getDeliveryAddress()->getContactAddress()) {
            $this->orderAddressManager->getAndSetOrderAddressByContactAddress(
                $cart->getDeliveryAddress()->getContactAddress(),
                null,
                null,
                $cart->getDeliveryAddress()
            );
        }

        // reapply delivery-addresses of every item
        foreach ($cart->getItems() as $item) {
            if ($item->getDeliveryAddress() &&
                $item->getDeliveryAddress()->getContactAddress()
            ) {
                $this->orderAddressManager->getAndSetOrderAddressByContactAddress(
                    $item->getDeliveryAddress()->getContactAddress(),
                    null,
                    null,
                    $item->getDeliveryAddress()
                );
            }
        }
    }
private function reApplyOrderAddresses ( $ cart , $ user ) { // validate addresses $ this -> validateOrCreateAddresses ( $ cart , $ user ) ; // reapply invoice address of cart if ( $ cart -> getInvoiceAddress ( ) -> getContactAddress ( ) ) { $ this -> orderAddressManager -> getAndSetOrderAddressByContactAddress ( $ cart -> getInvoiceAddress ( ) -> getContactAddress ( ) , null , null , $ cart -> getInvoiceAddress ( ) ) ; } // reapply delivery address of cart if ( $ cart -> getDeliveryAddress ( ) -> getContactAddress ( ) ) { $ this -> orderAddressManager -> getAndSetOrderAddressByContactAddress ( $ cart -> getDeliveryAddress ( ) -> getContactAddress ( ) , null , null , $ cart -> getDeliveryAddress ( ) ) ; } // reapply delivery-addresses of every item foreach ( $ cart -> getItems ( ) as $ item ) { if ( $ item -> getDeliveryAddress ( ) && $ item -> getDeliveryAddress ( ) -> getContactAddress ( ) ) { $ this -> orderAddressManager -> getAndSetOrderAddressByContactAddress ( $ item -> getDeliveryAddress ( ) -> getContactAddress ( ) , null , null , $ item -> getDeliveryAddress ( ) ) ; } } }
Reapplies order-addresses on submit

@param ApiOrderInterface $cart
Reapplies order - addresses on submit