How to handle Pre Orders in OpenCart
OpenCart does a great job of handeling many aspects of eCommerce. However, PreOrders can be a bit confusing.
The problem surfaces when you want to allow PreOrders but prevent the purchase of Out of Stock items.
An Out of Stock item is one which is not in the inventory, by this definition a item for Pre-Order is also classified as Out Of Stock.
This guide will show how to handle these special cases.
1. Allow purchase of Out Of Stock items.
This may sound counter productive but stick with me. Customers won’t be allowed to purchase Pre-Order Items without it, remember that a product is only given the status Pre-Order when its product quantity is zero.
Go to System->Settings-> (Default Store)->Options (Tab) and scroll down to “Stock” and set the following Options:
Show Out Of Stock Warning: No
Stock Checkout: Yes
Out Of Stock Status: “Out of Stock” <- Default when adding new products.
2. Set Product as PreOrder.
First Got to Catalog->Products-> (Chosen Product)->Data (Tab) Set the following Settings:
Minimum Quantity: (your discretion)
Subtract Stock: No
Out Of Stock Status: “Pre-Order”
3. Set Product Quantities.
This is the most important part. This is where everything comes together.
Go to Catalog->Products-> (Chosen Product)->Options (Tab)
Even If the product only has one variation, it still needs to have an option set here. Also, make sure that Required is set to “yes”
If you need help setting default option values please Click Here
Lets break down whats happening here, in the Data Tab the Out Of Stock Status only shows “Pre-Order” when the Stock Quantity reaches Zero.
and looks like this:
The reason we set Subtract Stock to “No” (Data Tab) is so that when we want to change the status to “In Stock,” all we need to do is set the Quantity to “1″. Think of this Quantity setting only as a trigger for the Stock Status.
Next, when we set the Stock Quantities (Options Tab), this is the real stock quantity for the item. Once the quantity for each option reaches Zero the option is no longer available and the user is not allowed to add it to the cart. This solves the problem of the user purchasing a product which is no longer available.
I see only one scenario which is not covered. OpenCart doesn’t allow you to enable Pre-Sales on a product but prevent sales on product options by option quantity. This means even though a product option may only have 5 items available, the user can still checkout with 100 in their cart. This will not do…..
Update: With a little modification of OpenCart source code, we now have a nice little rejection if someone tries to add a quantity which is too large for the chosen Option.
Update: Still, if someone wanted to be scandalous, they could put 1 in the Qty field and repeatedly click “ADD TO CART”, and because OpenCart doesn’t remove the quantity until after checkout we need to do some handeling in the cart itself via another mod.