How to Display the "Backorder" Message when Stock is Low
Ordering and Backordering
ProductCart uses the following methods to determine whether a product can be purchased:
- Current Product Inventory
- A Product's Backorder Setting
- A Product's Disregard Stock Setting
When a Product is added to the cart, the following scenarios can occur:
Product is in stock
IF the current stock level is equal to or greater than the quantity the customer has added to the cart OR if the “Disregard Stock” flag is set to YES for the product, THEN:- The product is added to the cart
- No “Backorder” flag is set (even if Backorder is enabled)
- The current stock level is decreased immediately (to avoid a situation where other customers can buy “out-of-stock” products).
Product is out of stock, backorder OK
IF the number of units being purchased exceeds the current stock level for the product AND the “Backorder” flag is turned ON for the product AND the “Disregard Stock” flag is turned OFF (otherwise all inventory features are ignored), THEN:- The Product is added to the cart, but this time the “Backorder” flag is ON
- The “Backorder Message” is shown
- The fact that the product is in a backorder status is saved into the database with all the other order details: even if the inventory levels change for that same product, the product will still appear on the Backorder Report (because at the time the item was purchased, it was back-ordered).
Product is out of stock, backorder NOT OK
IF the number of units being purchased exceeds the current stock level for the product AND the “Backorder” flag is turned OFF for the product AND the “Disregard Stock” flag is turned OFF (otherwise all inventory features are ignored), THEN: the customer will not be able to add the product to the cart.Backorder Report: When a product appears there
To recap the above, the Backorder Report will display all orders that contain products that were in a “back-order” status at the time the order was placed… and have not yet shipped. The orders must be in one of the following status:- Pending
- Processed
- Partially Shipped
- Shipping
- Partially Return
Customization: Show message on low inventory
You can make a small customization to the code to change the behavior so that the message is displayed when inventory falls below a certain number. For example, let's assume that you would like the message to be shown when inventory falls below 10 units.- Download the file viewPrdCode.asp from the pc folder
- Locate the following code:
If (scOutofStockPurchase=-1 AND CLng(pStock)<1 AND pserviceSpec=0 AND pNoStock=0 AND pcv_intBackOrder=1) OR (pserviceSpec<>0 AND scOutofStockPurchase=-1 AND iBTOOutofstockpurchase=-1 AND CLng(pStock)<1 AND pNoStock=0 AND pcv_intBackOrder=1) Then
- Change the two instances of…
CLng(pStock)<1
- … with:
CLng(pStock)<10
… assuming 10 is the number that you want to use. - Save the file and upload it back to the pc folder.