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?
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.
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.
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();
}
}
}
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?
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
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
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:
Thanks Soren that works
is working on a reply...