From 2521ecd6ad331e950a618d10d2d31ac702878721 Mon Sep 17 00:00:00 2001 From: Jesse van der Poel Date: Wed, 13 Dec 2023 09:23:18 +0100 Subject: [PATCH 1/2] Added experimental usev2 to addProductsToCartForm --- .../components/AddProductsToCart/AddProductsToCartForm.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/magento-product/components/AddProductsToCart/AddProductsToCartForm.tsx b/packages/magento-product/components/AddProductsToCart/AddProductsToCartForm.tsx index c8be97baf4..64f99377ff 100644 --- a/packages/magento-product/components/AddProductsToCart/AddProductsToCartForm.tsx +++ b/packages/magento-product/components/AddProductsToCart/AddProductsToCartForm.tsx @@ -79,6 +79,7 @@ export function AddProductsToCartForm(props: AddProductsToCartFormProps) { AddProductsToCartDocument, { ...formProps, + experimental_useV2: true, // We're stripping out incomplete entered options. onBeforeSubmit: async (variables) => { const variables2 = (await formProps.onBeforeSubmit?.(variables)) ?? variables From 59844cdd8adfaf03d22b04b9082552e22f386fb6 Mon Sep 17 00:00:00 2001 From: Jesse van der Poel Date: Wed, 13 Dec 2023 09:26:44 +0100 Subject: [PATCH 2/2] Added changeset --- .changeset/odd-balloons-sleep.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/odd-balloons-sleep.md diff --git a/.changeset/odd-balloons-sleep.md b/.changeset/odd-balloons-sleep.md new file mode 100644 index 0000000000..0dd59bd2fd --- /dev/null +++ b/.changeset/odd-balloons-sleep.md @@ -0,0 +1,5 @@ +--- +'@graphcommerce/magento-product': patch +--- + +Fixed a bug which caused the default values of the productAddToCartForm to be overwritten if the selected configurable option of a product contained a visible simple product. Before the fix you could not add the same product twice without reloading the page.