From af3b1526811b09e67f1e8aa537ccb2386cbe9537 Mon Sep 17 00:00:00 2001 From: rahulshukla-home Date: Wed, 6 May 2020 11:36:07 +0530 Subject: [PATCH 1/2] Issue #2987 --- packages/Webkul/Checkout/src/Cart.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/Webkul/Checkout/src/Cart.php b/packages/Webkul/Checkout/src/Cart.php index 947d68ef1..59b73dd48 100755 --- a/packages/Webkul/Checkout/src/Cart.php +++ b/packages/Webkul/Checkout/src/Cart.php @@ -498,7 +498,7 @@ class Cart $this->saveAddressesWhenRequested($data, $billingAddressData, $shippingAddressData); $this->linkAddresses($cart, $billingAddressData, $shippingAddressData); - + $this->assignCustomerFields($cart); $cart->save(); @@ -1191,14 +1191,17 @@ class Cart { $billingAddressModel = $cart->billing_address; if ($billingAddressModel) { + $billingAddressData['address_type'] = CartAddress::ADDRESS_TYPE_BILLING; $this->cartAddressRepository->update($billingAddressData, $billingAddressModel->id); if ($cart->haveStockableItems()) { $shippingAddressModel = $cart->shipping_address; if ($shippingAddressModel) { if (isset($billingAddressData['use_for_shipping']) && $billingAddressData['use_for_shipping']) { + $billingAddressData['address_type'] = CartAddress::ADDRESS_TYPE_SHIPPING; $this->cartAddressRepository->update($billingAddressData, $shippingAddressModel->id); } else { + $billingAddressData['address_type'] = CartAddress::ADDRESS_TYPE_SHIPPING; $this->cartAddressRepository->update($shippingAddressData, $shippingAddressModel->id); } } else { From 83cb0ff3d896fa682977f0073fd55c5ce8a950b3 Mon Sep 17 00:00:00 2001 From: rahulshukla-home Date: Wed, 6 May 2020 11:39:45 +0530 Subject: [PATCH 2/2] Issue #2987 --- packages/Webkul/Checkout/src/Cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Webkul/Checkout/src/Cart.php b/packages/Webkul/Checkout/src/Cart.php index 59b73dd48..2f770abe0 100755 --- a/packages/Webkul/Checkout/src/Cart.php +++ b/packages/Webkul/Checkout/src/Cart.php @@ -1201,7 +1201,7 @@ class Cart $billingAddressData['address_type'] = CartAddress::ADDRESS_TYPE_SHIPPING; $this->cartAddressRepository->update($billingAddressData, $shippingAddressModel->id); } else { - $billingAddressData['address_type'] = CartAddress::ADDRESS_TYPE_SHIPPING; + $shippingAddressData['address_type'] = CartAddress::ADDRESS_TYPE_SHIPPING; $this->cartAddressRepository->update($shippingAddressData, $shippingAddressModel->id); } } else {