Skip to content

Commit

Permalink
Merge pull request #101 from magento-folks/bugfix
Browse files Browse the repository at this point in the history
[Folks] Bugfix
  • Loading branch information
Volodymyr Klymenko authored Jun 13, 2016
2 parents 8b81f91 + c20f8f3 commit 4b6e1da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public function save(CartInterface $quote, CartItemInterface $item)
/** Update item product options */
$item = $quote->updateItem($itemId, $buyRequestData);
} else {
$currentItem->setQty($qty);
if ($item->getQty() !== $currentItem->getQty()) {
$currentItem->setQty($qty);
}
}
} else {
/** add new item to shopping cart */
Expand Down
26 changes: 0 additions & 26 deletions app/code/Magento/Quote/Model/QuoteRepository/SaveHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
*/
namespace Magento\Quote\Model\QuoteRepository;

use Magento\Framework\App\ObjectManager;
use Magento\Quote\Api\Data\CartInterface;
use Magento\Framework\Exception\InputException;
use Magento\Framework\Exception\CouldNotSaveException;

class SaveHandler
{
Expand All @@ -32,11 +30,6 @@ class SaveHandler
*/
private $shippingAssignmentPersister;

/**
* @var \Magento\Framework\Message\PhraseFactory
*/
private $phraseFactory;

/**
* @param \Magento\Quote\Model\ResourceModel\Quote $quoteResource
* @param \Magento\Quote\Model\Quote\Item\CartItemPersister $cartItemPersister
Expand Down Expand Up @@ -77,13 +70,6 @@ public function save(CartInterface $quote)
}
}
}
$errors = $quote->getErrors();
if (!empty($errors)) {
$phraseFactory = $this->getPhraseFactory();
throw new CouldNotSaveException(
$phraseFactory->create('Following errors occurred on save: %1', $errors)
);
}

// Billing Address processing
$billingAddress = $quote->getBillingAddress();
Expand All @@ -97,18 +83,6 @@ public function save(CartInterface $quote)
return $quote;
}

/**
* @deprecated
* @return \Magento\Framework\Message\PhraseFactory
*/
private function getPhraseFactory()
{
if (!is_object($this->phraseFactory)) {
$this->phraseFactory = ObjectManager::getInstance()->get(\Magento\Framework\Message\PhraseFactory::class);
}
return $this->phraseFactory;
}

/**
* @param \Magento\Quote\Model\Quote $quote
* @return void
Expand Down

0 comments on commit 4b6e1da

Please sign in to comment.