Merge pull request #3008 from rahulcs0082/development

Issue #2987
This commit is contained in:
Jitendra Singh 2020-05-06 12:03:29 +05:30 committed by GitHub
commit b42ccbfa9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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 {
$shippingAddressData['address_type'] = CartAddress::ADDRESS_TYPE_SHIPPING;
$this->cartAddressRepository->update($shippingAddressData, $shippingAddressModel->id);
}
} else {