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.

  • Chris 34 posts 134 karma points
    May 28, 2015 @ 18:11
    Chris
    0

    Order status of RequiresAttention

    We have a requirement where during the checkout process the customer can save their checkout progress, and ask the shop owner to review what they have added to their basket so far - change quantity, maybe remove items etc.

    My first thought was to use the API to change the basket status to Requires Attention, then once the order has been reviewed trigger an email to the customer which has a GUID that is then used to retreive the order and allow them to pay. Although this worked in the uCommerce admin screens there is an issue with it. When in the status of Requires Attention it isn't possible to make modifications to orders in the same way as you can with orders in the status of New Order. 

    Is this a valid approach or is there another easier way to implement this functionality?

     

  • Martin 181 posts 740 karma points
    May 30, 2015 @ 17:15
    Martin
    0

    Hi Chris,

    By default you're only allowed to edit orders with order status "New order" in the backend. Although this can be changed. If you open SQL Management Studio (or equivalent tool), find your database -> uCommerce_OrderStatus. Then change the value for column "AllowOrderEdit" for "Requires attention" to true / 1.

    I recommend you creating a new order status instead of using "Requires attention" since this is a standard uCommerce order status in case an error occur during capture money from a payment provider.

    If it was me I would create a new one called "Order for review" or something similar.

    Hope it answer your question.

    Best regards Martin

  • Chris 34 posts 134 karma points
    Jun 01, 2015 @ 10:36
    Chris
    0

    Thanks Martin, that makes sense I've made this change now and it works well.

    What I need to add now is the functionality for the customer to pay for this basket later. I have a webage they can view which loads shows the orders in the status of "Order for review", and from this I have access to the Guid for the purchase order.

    What I was hoping to be able to do is replace one of these saved baskets as the one that gets retrieved from the TransactionLibrary.GetBasket() call. Is there an easy way of doing this or would I need to extend the OrderContext class as shown here: http://docs.ucommerce.net/ucommerce/v6.6/extending-ucommerce/change-default-basket-behavior.html

     

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jun 02, 2015 @ 12:55
    Søren Spelling Lund
    101

    Hi Chris,

    To make sure that the change is global, the simplest approach is to change the way order context works.

    You can use the behavior in the OrderContext to look for a guid in querystring and replace the returned basket with the specified order. Something along the lines of:

    public class SpecificOrderContext : OrderContext
    {
        public override Basket GetBasket()
        {
            string orderGuidString = Request.QueryString["orderguid"];
            if (orderGuidString != null)
            {
                Guid orderGuid;
                if (Guid.TryParse(orderGuidString, out orderGuid))
                {
                    var order = PurchaseOrder.SingleOrDefault(x => x.OrderGuid == orderGuid);
    
                    if (order != null) return new Basket(order);
                }
    
                // If no order found with specified guid
                // revert to default behavior.
                return base.GetBasket();
            }
        }
    } 
  • Chris 34 posts 134 karma points
    Jun 03, 2015 @ 11:08
    Chris
    0

    Thanks Soren that works

Please Sign in or register to post replies

Write your reply to:

Draft