Skip to content

Commit

Permalink
Merge forwardport of #11458 to 2.3-develop branch
Browse files Browse the repository at this point in the history
Applied pull request patch https://github.com/magento/magento2/pull/11458.patch (created by @peterjaap) based on commit(s):
  1. 80ed833
  2. 24d6a57
  3. a19eeb2
  4. 846f117

Fixed GitHub Issues in 2.3-develop branch:
  - #2991: Products added to cart with REST API give total prices equal to zero (reported by @degaray)
  • Loading branch information
magento-engcom-team authored Feb 5, 2018
2 parents 26f3109 + e60ecdf commit c223484
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/code/Magento/Quote/Model/QuoteManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ public function createEmptyCart()
$quote->setShippingAddress($this->quoteAddressFactory->create());

try {
$quote->getShippingAddress()->setCollectShippingRates(true);
$this->quoteRepository->save($quote);
} catch (\Exception $e) {
throw new CouldNotSaveException(__('Cannot create quote'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,15 @@ public function testCreateEmptyCartAnonymous()
$quoteId = 2311;

$quoteMock = $this->createMock(\Magento\Quote\Model\Quote::class);

$quoteAddress = $this->createMock(\Magento\Quote\Model\Quote\Address::class);
$quoteAddress = $this->createPartialMock(
\Magento\Quote\Model\Quote\Address::class,
['setCollectShippingRates']
);
$quoteAddress->expects($this->once())->method('setCollectShippingRates')->with(true);

$quoteMock->expects($this->any())->method('setBillingAddress')->with($quoteAddress)->willReturnSelf();
$quoteMock->expects($this->any())->method('setShippingAddress')->with($quoteAddress)->willReturnSelf();
$quoteMock->expects($this->any())->method('getShippingAddress')->willReturn($quoteAddress);

$this->quoteAddressFactory->expects($this->any())->method('create')->willReturn($quoteAddress);

Expand Down

0 comments on commit c223484

Please sign in to comment.