-
Notifications
You must be signed in to change notification settings - Fork 83
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
OCC-199: Prevent checking out if there are unavailable products in the cart #377
Conversation
# Conflicts: # src/Modules/OrchardCore.Commerce/Services/PaymentService.cs # src/Modules/OrchardCore.Commerce/Services/ShoppingCartHelpers.cs # src/Modules/OrchardCore.Commerce/ViewModels/CheckoutViewModel.cs # src/Modules/OrchardCore.Commerce/Views/ShoppingCart/Index.cshtml
This comment has been minimized.
This comment has been minimized.
I found a way to still reproduce the original error. If you set the inventory of Test Free Product (which allows back-order) to 0 and try to check out you still get the "Inventory value cannot be negative." error. |
src/Libraries/OrchardCore.Commerce.Abstractions/Abstractions/ICheckoutEvents.cs
Outdated
Show resolved
Hide resolved
src/Modules/OrchardCore.Commerce.Payment/Services/PaymentService.cs
Outdated
Show resolved
Hide resolved
src/Modules/OrchardCore.Commerce.Payment/Services/PaymentService.cs
Outdated
Show resolved
Hide resolved
src/Modules/OrchardCore.Commerce/Services/ShoppingCartHelpers.cs
Outdated
Show resolved
Hide resolved
src/Modules/OrchardCore.Commerce/Views/ShoppingCart/Index.cshtml
Outdated
Show resolved
Hide resolved
test/OrchardCore.Commerce.Tests.UI/Tests/InventoryTests/InventoryBehaviourTests.cs
Outdated
Show resolved
Hide resolved
src/Modules/OrchardCore.Commerce/Views/ShoppingCart/Index.cshtml
Outdated
Show resolved
Hide resolved
test/OrchardCore.Commerce.Tests.UI/Tests/InventoryTests/InventoryBehaviourTests.cs
Outdated
Show resolved
Hide resolved
test/OrchardCore.Commerce.Tests.UI/Tests/InventoryTests/InventoryBehaviourTests.cs
Outdated
Show resolved
Hide resolved
Looks like the allows back order value is not properly taken into account during checkout. How should this work when the inventory still has items available and back ordering is allowed -- inventory should be decreased as normal, right? As long as it doesn't go below 0, that is. |
src/Modules/OrchardCore.Commerce/Events/InventoryCheckoutEvents.cs
Outdated
Show resolved
Hide resolved
src/Modules/OrchardCore.Commerce/Services/ShoppingCartHelpers.cs
Outdated
Show resolved
Hide resolved
src/Modules/OrchardCore.Commerce/Views/ShoppingCart/Index.cshtml
Outdated
Show resolved
Hide resolved
Yeah, inventory should still be decreased. I think you just have to change this line to also take |
OCC-199
Fixes #375