Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 0x15f/9a449319023b956fedffd357855c23ce to your computer and use it in GitHub Desktop.
Save 0x15f/9a449319023b956fedffd357855c23ce to your computer and use it in GitHub Desktop.
Magento2 GraphQL cannot add product with customizable option to cart #37599 #37652
From ae5c89e5af2c14dea33b5c5d49ead84d55fd02f8 Mon Sep 17 00:00:00 2001
From: Shomi Adarsh <shomi.adarsh@gds.ey.com>
Date: Thu, 22 Jun 2023 13:48:07 +0530
Subject: [PATCH] GraphQL cannot add product with customizable option to cart
#37599
---
vendor/magento/module-quote/Model/Quote.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/vendor/magento/module-quote/Model/Quote.php b/vendor/magento/module-quote/Model/Quote.php
index 572d87d5f4bec..6a2575d974336 100644
--- a/vendor/magento/module-quote/Model/Quote.php
+++ b/vendor/magento/module-quote/Model/Quote.php
@@ -1647,6 +1647,8 @@ public function addProduct(
);
}
+ $productId = $product->getId();
+ $product = clone $this->productRepository->getById($productId, false, $this->getStore()->getId());
$cartCandidates = $product->getTypeInstance()->prepareForCartAdvanced($request, $product, $processMode);
/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment