Skip to content

Commit 682e62b

Browse files
author
olysenko
committed
Merge branch 'develop' into MAGETWO-53424
2 parents ffdfcb9 + 4b6e1da commit 682e62b

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

app/code/Magento/Quote/Model/Quote/Item/CartItemPersister.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ public function save(CartInterface $quote, CartItemInterface $item)
7171
/** Update item product options */
7272
$item = $quote->updateItem($itemId, $buyRequestData);
7373
} else {
74-
$currentItem->setQty($qty);
74+
if ($item->getQty() !== $currentItem->getQty()) {
75+
$currentItem->setQty($qty);
76+
}
7577
}
7678
} else {
7779
/** add new item to shopping cart */

app/code/Magento/Quote/Model/QuoteRepository/SaveHandler.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
*/
66
namespace Magento\Quote\Model\QuoteRepository;
77

8-
use Magento\Framework\App\ObjectManager;
98
use Magento\Quote\Api\Data\CartInterface;
109
use Magento\Framework\Exception\InputException;
11-
use Magento\Framework\Exception\CouldNotSaveException;
1210

1311
class SaveHandler
1412
{
@@ -32,11 +30,6 @@ class SaveHandler
3230
*/
3331
private $shippingAssignmentPersister;
3432

35-
/**
36-
* @var \Magento\Framework\Message\PhraseFactory
37-
*/
38-
private $phraseFactory;
39-
4033
/**
4134
* @param \Magento\Quote\Model\ResourceModel\Quote $quoteResource
4235
* @param \Magento\Quote\Model\Quote\Item\CartItemPersister $cartItemPersister
@@ -77,13 +70,6 @@ public function save(CartInterface $quote)
7770
}
7871
}
7972
}
80-
$errors = $quote->getErrors();
81-
if (!empty($errors)) {
82-
$phraseFactory = $this->getPhraseFactory();
83-
throw new CouldNotSaveException(
84-
$phraseFactory->create('Following errors occurred on save: %1', $errors)
85-
);
86-
}
8773

8874
// Billing Address processing
8975
$billingAddress = $quote->getBillingAddress();
@@ -97,18 +83,6 @@ public function save(CartInterface $quote)
9783
return $quote;
9884
}
9985

100-
/**
101-
* @deprecated
102-
* @return \Magento\Framework\Message\PhraseFactory
103-
*/
104-
private function getPhraseFactory()
105-
{
106-
if (!is_object($this->phraseFactory)) {
107-
$this->phraseFactory = ObjectManager::getInstance()->get(\Magento\Framework\Message\PhraseFactory::class);
108-
}
109-
return $this->phraseFactory;
110-
}
111-
11286
/**
11387
* @param \Magento\Quote\Model\Quote $quote
11488
* @return void

0 commit comments

Comments
 (0)