Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the amount for a CartItem to zero or less than zero should remove it from the Cart #365

Closed
odrotbohm opened this issue Oct 26, 2021 · 0 comments
Labels
module: orders Orders type: enhancement Improvements and new features
Milestone

Comments

@odrotbohm
Copy link
Member

Cart.addOrUpdateItem(…) will happily update a CartItem's quantity to a zero or less-than-zero value. We should transparently remove the CartItem from the item and flatten the quantity value of the item returned to zero.

@odrotbohm odrotbohm added type: enhancement Improvements and new features module: orders Orders labels Oct 26, 2021
@odrotbohm odrotbohm added this to the 7.5 milestone Oct 26, 2021
odrotbohm added a commit that referenced this issue Sep 27, 2022
… item from Cart.

Changed CartItem to not allow quantities of zero or negative. Added Quantity.isPositive() and ….isZeroOrPositive() for symmetry with ….is(ZeroOr)Negative(). Operations updating the quantity for a product in the Cart now returns an Optional to represent that a calculated quantity of zero will remove the CartItem from the Cart and it might not be available anymore.
odrotbohm added a commit that referenced this issue Sep 27, 2022
Wer-Wolf added a commit to Wer-Wolf/salespoint that referenced this issue Dec 9, 2022
Since st-tu-dresden#365, a CartItem is removed if its quantity is less than or equal
to zero. This however was not properly documented, causing people to
assume that a CartItem is removed only if its Quantity is equal to zero.
Fix this by updating the documentation.

Signed-off-by: Armin Wolf <armin.wolf@mailbox.tu-dresden.de>
Wer-Wolf added a commit to Wer-Wolf/salespoint that referenced this issue Dec 12, 2022
Since st-tu-dresden#365, a CartItem is removed if its quantity is less than or equal
to zero. This however was not properly documented, causing people to
assume that a CartItem is removed only if its Quantity is equal to zero.
Fix this by updating the documentation.

Signed-off-by: Armin Wolf <armin.wolf@mailbox.tu-dresden.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: orders Orders type: enhancement Improvements and new features
Projects
None yet
Development

No branches or pull requests

1 participant