Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Stefan 13 posts 53 karma points
    Jan 21, 2014 @ 13:56
    Stefan
    0

    Best way for member Order History

    Hello, 

    what is the best way to get the order history of a member? I like to select all orders with orderstatus paied or completed. And I like to do this in C# via the API? Is it possible? And if how? 

    Thanks in advance,

    Stefan Volkmer

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Jan 21, 2014 @ 14:11
    Nickolaj Lundgreen
    101

    I have made a simple extension (made some untested changes before posting - but i think you can get some idears):

    public static IEnumerable<PurchaseOrder> GetCompletedOrders(this Customer customer)
        {
            return
                PurchaseOrder.All().Where(
                    x => x.Customer.CustomerId == customer.CustomerId && x.OrderStatus.OrderStatusId > 1 && x.OrderStatus != OrderStatus.Get((int)OrderStatusCode.Cancelled));
        }
    

    Is that what you are looking for? I have some markup aswell?

  • Stefan 13 posts 53 karma points
    Jan 21, 2014 @ 14:19
    Stefan
    0

    Wow !!! That was fast ;) 

    Thanks that exactly what I was looking for!

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Jan 21, 2014 @ 14:30
    Nickolaj Lundgreen
    0

    A small request: If you mark the question as answered, it's easier to keep track of questions that needs attention:)

Please Sign in or register to post replies

Write your reply to:

Draft