Is there a way to get Product details from an order?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 Jahre weitere
Working on a modified administration page.
Trying to get the products detail from any order.

What I've tried so far:

OrderCollection orders = OrderManager.SearchOrders(startDate, endDate, txtCustomerEmail.Text, orderStatus, paymentStatus, shippingStatus);

foreach (Order order in orders)
{
    int orderID = order.OrderID;
}

return orders;


Any help appreciated.

Thanks
14 Jahre weitere
After a bit of messing about I came up with this:


OrderCollection orders = OrderManager.SearchOrders(startDate, endDate, txtCustomerEmail.Text, orderStatus, paymentStatus, shippingStatus);

foreach (Order order in orders)
{
    int orderID = order.OrderID;
    OrderProductVariantCollection orderProductVariants = order.OrderProductVariants;
    foreach (OrderProductVariant orderProductVariant in orderProductVariants)
    {
        Product product = orderProductVariant.ProductVariant.Product;
    }
}
14 Jahre weitere
With the code above I get the following error:
Collection was modified; enumeration operation may not execute. 


Any ideas?

Thanks
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.