-
Notifications
You must be signed in to change notification settings - Fork 90
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-163: PriceVariantsPart doesn't support InventoryPart #315
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
var inventory = part.Inventory ?? new Dictionary<string, int>(); | ||
if (inventory.Any()) | ||
{ | ||
// Workaround for InventoryPart storing the outdated inventory entries along with the updated ones. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The InventoryKeys
list property is used as a workaround to the incorrectly working dictionary property. For some reason, list properties do not retain cleared values (which is working as intended), while dictionaries do.
This comment has been minimized.
This comment has been minimized.
src/Modules/OrchardCore.Commerce.Inventory/Drivers/InventoryPartDisplayDriver.cs
Outdated
Show resolved
Hide resolved
src/Modules/OrchardCore.Commerce.Inventory/Views/InventoryPart.Edit.cshtml
Show resolved
Hide resolved
{ | ||
part.CanBeBought.Clear(); | ||
|
||
var correctInventory = inventoryPart.Inventory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This invertory correction could be extraced into a method and use that in multiple places.
OCC-163
Fixes #302