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.

  • slava 9 posts 29 karma points
    May 22, 2015 @ 14:50
    slava
    0

    Is any way in UI or by request to clear old purchese orders with status basket?

    Is any way in UI or by request to clear old purchese orders with status basket? I see them a lot in my db and perfomance is slow.

  • Martin 181 posts 740 karma points
    May 22, 2015 @ 22:58
    Martin
    0

    Hi slava,

    You can do it pretty easy through uCommerce API (Unless you have a uCommerce version older than 2.5.0.0).

    The following code is untested:

    var baskets = PurchaseOrder.Find(x => x.IsBasket && x.OrderStatus.Name == "Basket");
    
    foreach (var basket in baskets)
    {
        basket.Delete();
    }
    

    I would also only delete baskets older than a specific date otherwise you risk deleting a basket where a customer is about to go through checkout (That would be unfortunately).

    Best regards Martin

Please Sign in or register to post replies

Write your reply to:

Draft