Skip to content

Commit 0a0add8

Browse files
committed
MC-37484: Cart query error when trying to switch store view
1 parent 98d1258 commit 0a0add8

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,13 @@
1111
use Magento\Framework\GraphQl\Config\Element\Field;
1212
use Magento\Framework\GraphQl\Query\ResolverInterface;
1313
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
14-
use Magento\Quote\Model\Cart\Totals;
1514
use Magento\Quote\Model\Quote\Item;
16-
use Magento\Quote\Model\Quote\TotalsCollector;
1715

1816
/**
1917
* @inheritdoc
2018
*/
2119
class CartItemPrices implements ResolverInterface
2220
{
23-
/**
24-
* @var TotalsCollector
25-
*/
26-
private $totalsCollector;
27-
28-
/**
29-
* @var Totals
30-
*/
31-
private $totals;
32-
33-
/**
34-
* @param TotalsCollector $totalsCollector
35-
*/
36-
public function __construct(
37-
TotalsCollector $totalsCollector
38-
) {
39-
$this->totalsCollector = $totalsCollector;
40-
}
41-
4221
/**
4322
* @inheritdoc
4423
*/
@@ -49,12 +28,6 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
4928
}
5029
/** @var Item $cartItem */
5130
$cartItem = $value['model'];
52-
53-
if (!$this->totals) {
54-
// The totals calculation is based on quote address.
55-
// But the totals should be calculated even if no address is set
56-
$this->totals = $this->totalsCollector->collectQuoteTotals($cartItem->getQuote());
57-
}
5831
$currencyCode = $cartItem->getQuote()->getQuoteCurrencyCode();
5932

6033
return [

0 commit comments

Comments
 (0)