I only want to include items that are A) shippable and B) assigned to be shipped from a specific warehouse.
We have the current code in a .cs module special for this interface.
Here's my first problem. If you look at the code below, with the "&& item.Shippable != Shippable.No" condition in the if statement I do not get the items in kits and because of the "&& item.Product.KitStatus != KitStatus.Master" I won't get the kit master product either (which is the intention). If I remove the "&& item.Shippable != Shippable.No" then all the items in the kit get properly listed in the XML (I left out the details of the XML.Append as they are not the problem and just make the code longer and harder to read). Why would it include the items in the kit when there is no test for "shippable" and not include them when the test for "shippable" is in the if statement? Maybe I am going blind!
Code: Select all
foreach (OrderItem item in _Order.Items)
{
//order items
if (item.OrderItemType == OrderItemType.Product && item.Product != null
&& item.Product.KitStatus != KitStatus.Master && item.Shippable != Shippable.No)
{
// xml append commands to insert the items and quantities
}
}
//end order items
BTW, let me answer at least one of the obvious questions.
It seems that the items in the kit are not included regardless of the master product (the kit) is "shippable' or not or if the component items are marked as "shippable" or not.
If I have a product (not a kit) that is not shippable, the if shown in the code segment above really does exclude it from the xml.
Inputs are appreciated.