Skip to content

Commit 2c41698

Browse files
AnujNehraAnujNehra
authored andcommitted
ACP2E-1975: GraphQL cannot add product with customizable option to cart
1 parent 2656d29 commit 2c41698

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/code/Magento/Quote/Model/Cart/AddProductsToCart.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@ private function prepareErrorOutput(Quote $cart, array $errors = []): AddProduct
211211
/**
212212
* Set options from product options collection
213213
*
214-
* @param ProductInterface $productItem
214+
* @param ProductInterface|null $productItem
215215
* @return ProductInterface|null
216216
*/
217-
private function getProductOptions(ProductInterface $productItem): ?ProductInterface
217+
private function getProductOptions(ProductInterface|null $productItem): ?ProductInterface
218218
{
219-
$productItem->setOptions($productItem->getProductOptionsCollection()->getItems());
219+
$productItem?->setOptions($productItem->getProductOptionsCollection()->getItems());
220220
return $productItem;
221221
}
222222
}

0 commit comments

Comments
 (0)