When an item added to cart show a success message with product name and quantity added #3667
Unanswered
icreatestuff
asked this question in
Q&A
Replies: 1 comment
-
|
@icreatestuff sorry for delay on response for this one. If you are doing an ajax request to the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When a customer adds a product to their cart I need to be able to show a modal or similar that indicates the success including details about the specific product and quantity just added.
The
commerce/cart/update-cartaction provides a successful response but doesn't provide any detail about what was added as far as I can tell.A workaround that gets about 90% of the way is to pass the product ID from the current page to the modal and then loop over all the cart line items only outputting the one with a matching product ID. However, the quantity shown is the current total quantity of that item in the cart, rather than the quantity just added. I may have added 1 already and then subsequently added another. The modal should indicate that 1 was just added, but with my current implementation will show 2 just added.
Are there any existing ways to get something like this? Thanks
Beta Was this translation helpful? Give feedback.
All reactions