Skip to content

Commit adb7ff0

Browse files
author
Oleksandr Iegorov
committed
MC-42652: GraphQL - Expected behavior of add product to cart when SKU already exists
1 parent ec98d13 commit adb7ff0

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

app/code/Magento/QuoteGraphQl/Model/Cart/AddSimpleProductToCart.php

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@
99

1010
use Exception;
1111
use Magento\Catalog\Api\ProductRepositoryInterface;
12-
use Magento\Framework\Model\Context;
13-
use Magento\Framework\Event\ManagerInterface;
1412
use Magento\Framework\Exception\NoSuchEntityException;
1513
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1614
use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException;
1715
use Magento\Quote\Model\Quote;
18-
use Magento\Quote\Model\Quote\Item\Processor;
1916
use Magento\QuoteGraphQl\Model\Cart\BuyRequest\BuyRequestBuilder;
20-
use Magento\Framework\App\CacheInterface;
2117

2218
/**
2319
* Add simple product to cart mutation
@@ -34,33 +30,16 @@ class AddSimpleProductToCart
3430
*/
3531
private $buyRequestBuilder;
3632

37-
/**
38-
* @var Processor
39-
*/
40-
private $itemProcessor;
41-
42-
/**
43-
* @var ManagerInterface
44-
*/
45-
private $eventManager;
46-
4733
/**
4834
* @param ProductRepositoryInterface $productRepository
4935
* @param BuyRequestBuilder $buyRequestBuilder
50-
* @param Processor $itemProcessor
51-
* @param Context $context
5236
*/
5337
public function __construct(
5438
ProductRepositoryInterface $productRepository,
55-
BuyRequestBuilder $buyRequestBuilder,
56-
Processor $itemProcessor,
57-
Context $context,
58-
CacheInterface $cache
39+
BuyRequestBuilder $buyRequestBuilder
5940
) {
6041
$this->productRepository = $productRepository;
6142
$this->buyRequestBuilder = $buyRequestBuilder;
62-
$this->itemProcessor = $itemProcessor;
63-
$this->eventManager = $context->getEventDispatcher();
6443
}
6544

6645
/**

0 commit comments

Comments
 (0)