Hello,
Having used Nop for quite some time, I know that there are regular conversations on the forums regarding the way that Nop creates an Order.
Summary:
Currently when a Customer clicks the Final button on the Confirm screen (this may be taking them off to a third-party payment provider such as WorldPay/PayPal) Nop creates an Order for that Customer. That in itself is fine - I like the fact that Nop creates an order at this stage because if the user does not go on to Pay, I can see what the dropout rate is. The problem that I, and most others that have raised it, have is that also at this point Nop allocates Stock to this order i.e. If I order Product A it now minuses 1 from the Stock Qty. At this stage Nop also sends the order confirmation email both to the customer and store owner. So there are a couple of fundamental problems here.
1) If Product A had a Stock Quantity of 1 at the time when the order was placed it is now Zero, and out-of-stock. If the Customer does not complete the order i.e. they don't complete payment, this Product has gone out of stock and no-one else can buy it. On one product that's not a massive issue, but on a site that sells thousands of products per week this is almost unmanageable. Let's also think about malicious attacks on our site, it is POSSIBLE (and possible it frankly all it needs to be to be a major risk) to write a script that will add every product to a customers cart, and go to checkout. This COULD set every product on our entire website out-of-stock!
2) The second issue is a usability. When else have you shopped online and received a order confirmation email before you have even paid - I can't honestly say I ever have, and I buy almost everything online!
As I understand it from reading Nop's responses to this frequently asked question, the reason that Nop works in this one (or one of the Major reasons) is to ensure that when the order is created the item is still in stock. If the order was created AFTER payment was complete then there is a slim possibility that someone else would have completed their order and rendered the product out-of-stock. Fair point, but I believe the risk of this happening is slim (unless you are the likes of Amazon) and if so the system has been engineered in a way that is terribly confusing and risky just to avoid the possibility of a slim occurence taking place.
I would like to make the following suggestions:
1) The first, and preferable solution is to create the order when the Customer clicks the Confirm button on the Checkout Confirm page, but to set the Status to something like "Awaiting Payment". When Payment has been completed (indicated by a Callback from a third party payment gateway), or when the Administrator clicks the "Mark as Paid" button on the order, the system checks that the products the customer just ordered are still in-stock, and if so updates the stock levels at this time - it should also change the Payment status to "Paid". If during doing so Nop discovers that one of the products ordered is out of stock, it raises an exception and changes the Order Status to "Unable to allocate stock" (or something along these lines). If an Order is marked as "Unable to allocate stock", the administrators options would be to :
- Add more stock and then click a "Try again" button within the order
- Refund and cancel the order.
This is exactly the process that takes place every day in high street shops. If I reserve an item and go into store to pick it up and for whatever reason it is no longer in stock, they refund me.
This seems like an absolutely perfect solution - to me anyway??? ;-)
2) Nop implement the logic in Point 1 alongside the current logic and make it optional based on a setting. i.e. the developer can choose whether they want the system to work as it currently does, or whether they want it to work as suggested in point 1. This enables the Nop team to still state they have a product that doesn't allow orders to be placed for out-of-stock items, whilst keeping the rest of us happy with a solution that reflects how we and our clients want to work.
Again, if you have any other suggestions please do submit them, but most importantly IF YOU BELIEVE THIS IS BENEFICIAL TO NOPCOMMERCE, PLEASE VOTE.
Thanks guys
Nop Team - please comment.
Al