From ef1483311e92027f36b4b2c1384759af76d11481 Mon Sep 17 00:00:00 2001 From: Zeel Date: Mon, 18 Mar 2024 17:26:58 +0530 Subject: [PATCH 1/2] solve multiple variant issue --- Service/Cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Service/Cart.php b/Service/Cart.php index 698cfc2..f5cff6e 100644 --- a/Service/Cart.php +++ b/Service/Cart.php @@ -207,7 +207,7 @@ public function getAddToCartRequest(string $sku, $qty, $discount = null) } if (is_numeric($parentProductId)) { - $parentProduct = $this->productRepository->getById($parentProductId, false, $storeId); + $parentProduct = $this->productRepository->getById($parentProductId, false, $storeId), true; $addToCartParams['product'] = $parentProduct->getId(); From acbe0922fc1f9a9e02c240c3e63959bdbf879b92 Mon Sep 17 00:00:00 2001 From: Zeel Date: Mon, 18 Mar 2024 17:28:05 +0530 Subject: [PATCH 2/2] added solution of multiple variant issue --- Service/Cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Service/Cart.php b/Service/Cart.php index f5cff6e..88c6d6f 100644 --- a/Service/Cart.php +++ b/Service/Cart.php @@ -207,7 +207,7 @@ public function getAddToCartRequest(string $sku, $qty, $discount = null) } if (is_numeric($parentProductId)) { - $parentProduct = $this->productRepository->getById($parentProductId, false, $storeId), true; + $parentProduct = $this->productRepository->getById($parentProductId, false, $storeId, true); $addToCartParams['product'] = $parentProduct->getId();