Video Tutorial - How to Setup Stock Hold Period in VPCart 9

Video Tutorial - How to Setup Stock Hold Period in VPCart 9

Step 1. To setup Stock Hold Period go to VPCart administration: Advanced settings >> Software configuration

Step 2. In the search box type in 'xstockcontrol' and click search icon

Step 3. Select 'yes' from drop and click Continue button

Step 4. similarly set xcheckStocklevel = Yes

Step 5. xstock_hold_enable = Yes xstock_hold_minutes = 60 (in minutes, just example)

Step 6. Now to test stock_hold we can set the stock for Catalod id 19 as 2(for example). For this go to Store >> products from admin Menu

Step 7. Click edit icon against product with Catalog id 19

Step 8. Scroll down the page until you find section "Advanced pricing and stock control". Click the drop down arrow.

Step 9. Set stock = 2 for testing Stock Hold Period

Step 10. Click Update Record

Step 11. Assume Customer A adds 2 quantity of catalog id 19 item to the cart. VPCart then will add a record into table stock_hold that saves the session id, catalog id, quantity, and date added.

Step 12. Say at the same time Customer B trying to add same product to the cart will get 'Quantity exceeds stock level' message

In this case the Customer A gets priority eventhough he is not completed the purchase and stock still shown as qty 2 for customer B

Step 13. Here is the explanation. Each time an “Add To Cart” process is executed, VPCart will check the following :

13a. 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.

13b. 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).

13c. 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).

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

Thank you for watching and we hope you have found this tutorial useful.

User Manual Reference

For more information about how to use Design Manager to change the look of your site, you can also refer to our VPCart 9 User Guide at

https://helpnotes.vpcart.com/userguide900/#!Documents/stockholdperiod.htm


Times Viewed:
399
Added By:
Brian
Date Created:
11/19/2018
Last Updated:
1/1/2020