Stock Hold Period

 

This is a new feature added in our VPCart 9.0.

VPCart Stock Hold Period feature allows customers (buyers) to temporarily reserve or hold products they have added to their shopping cart. When a customer adds items to his shopping cart, VPCart will reserve for certain minutes before they become available again to other customers.
This means this customer has the opportunity to purchase these products first.

 

Merchants can set from the shop configuration how long they want to keep the stock (in minutes).


How Does Stock Hold Period Process Work?

 

The Stock Hold Period feature work flow as below:

* Merchants set from shop configuration to activate the related configs
- xstockcontrol = Yes

- xcheckStocklevel = Yes

- xstock_hold_enable = Yes
- xstock_hold_minutes = 60 (in minutes, just example)

* Assume Product X has 2 qty and visitor John adds Product X with 1 qty to their cart.

* VPCart then will add a record into table stock_hold that saves the session id, catalog id, quantity, and date added.

* Another visitor Mary after few minues adds the same Product X with 1 qty to their cart.

* VPCart will again add a record into table stock_hold that saves the session id, catalog id, quantity, and date added.

* Another visitor Jane on the same time also try to add the same Product X with 1 qty to their cart.

* Visitor Jane after click the Add to Cart button, she gets the alert message “Quantity exceeds stock level (0) - Product X

* You will ask why visitor Jane unable to add Product X 1 qty into cart although if you go to Product administration for the Product X, it is still showing it has stock 2.

Here is the explanation:

Each time an “Add To Cart” process is executed, VPCart will check the following :

1) The related Stock Hold Period configs (xstockcontrol, xcheckStocklevel, xstock_hold_enable). Only if they are enabled then the Stock Hold Period routines will be called.

2) VPCart will get the value of config xstock_hold_minutes and do the deleting of the records in stock_hold table, that date time added are less than (current date time minus (-) xstock_hold_minutes).

3) VPCart will look into table “stock_hold” field catalogid and sum of total quantity value there and compare with the products table cstock field value ( cstock minus (-) sum of total quantity of same catalog id).

4) VPCart will compare the quantity of a cart item, with the result from no. 3)
If quantity of a cart item is greater than result from no. 3, then that visitor will get message “Quantity exceeds stock level”.


* The records in stock_hold table will be removed under the following rules:
- Orders has been processed (paid on payment page)
Or
- After certain period (as explained on point no. 2 above)

Software Configurations Used For Stock Hold Period


The following Software Configuration options control this feature:

xstock_hold_enable

Set this to Yes to enable Stock Hold Period feature.

xstock_hold_minutes

Enter the period in minutes for visitor to hold the stock after adding to the cart before checkout.

Example 60 means 60 minutes.

Note:
This config only work when the other configs below are set to Yes:
xstockcontrol
xcheckStocklevel
xstock_hold_enable