Skip to content

Commit

Permalink
Merge pull request #2150 from graphcommerce-org/bug/GCOM-1292-cant-ad…
Browse files Browse the repository at this point in the history
…d-same-item-twice

Cant add same configurable product to cart twice in a row (GCOM-1292)
  • Loading branch information
paales authored Jan 15, 2024
2 parents a4a1e2e + 59844cd commit 68e869a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-balloons-sleep.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

1 comment on commit 68e869a

@vercel
Copy link

@vercel vercel bot commented on 68e869a Jan 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

graphcommerce-hygraph-dynamic-rows-ui – ./packages/hygraph-dynamic-rows-ui

graphcommerce-hygraph-dynamic-rows-ui-git-canary-graphcommerce.vercel.app
graphcommerce-hygraph-dynamic-rows-ui-graphcommerce.vercel.app
graphcommerce-hygraph-dynamic-rows-ui.vercel.app

Please sign in to comment.