Need to build my own CheckStock
Posted: Fri Oct 15, 2010 3:58 pm
I need to build my own custom CheckStock because the AbleCommerce CheckStock does not take into account what is currently on order. It functions as such...
CheckStock(Sku w/o Variant) = Sku's InStock #
CheckStock(Sku w/ Variant) = Variant's InStock #
Our system/database calculates and stores a separate field for Allocated, which is the quantity of an item that is already on order. We do not DeStock items prior to shipping them. DeStocking only occurs once the items have been shipped. Therefore, when we pull those CheckStock values, it returns the quantity of an item that is In Stock but does not account for those already assigned to orders. This is a big deal for us because when customers go to purchase items, they appear to be In Stock, when in reality they may not be. What I need to do is have our CheckStock work as such...
CheckStockMod(Sku w/o Variant) = Sku's InStock # - Sku's Allocated #
CheckStockMod(Sku w/ Variant) = Variant's InStock # - Variant's Allocated #
I can build the query to get the proper Allocated values, but was wondering if someone can point me in the right direction for where I should place my function so that it is accessible by all the areas needed and what other things CheckStock may take into account that I should be aware of. Is there maybe a breakdown somewhere of what CheckStock's code looks like?
Or, if I am mistaken and there is a way to have CheckStock take into account the # of items that are currently on order, then that would solve my problem 100%. If anyone knows of something like that, please let me know.
Thanks,
Wil
CheckStock(Sku w/o Variant) = Sku's InStock #
CheckStock(Sku w/ Variant) = Variant's InStock #
Our system/database calculates and stores a separate field for Allocated, which is the quantity of an item that is already on order. We do not DeStock items prior to shipping them. DeStocking only occurs once the items have been shipped. Therefore, when we pull those CheckStock values, it returns the quantity of an item that is In Stock but does not account for those already assigned to orders. This is a big deal for us because when customers go to purchase items, they appear to be In Stock, when in reality they may not be. What I need to do is have our CheckStock work as such...
CheckStockMod(Sku w/o Variant) = Sku's InStock # - Sku's Allocated #
CheckStockMod(Sku w/ Variant) = Variant's InStock # - Variant's Allocated #
I can build the query to get the proper Allocated values, but was wondering if someone can point me in the right direction for where I should place my function so that it is accessible by all the areas needed and what other things CheckStock may take into account that I should be aware of. Is there maybe a breakdown somewhere of what CheckStock's code looks like?
Or, if I am mistaken and there is a way to have CheckStock take into account the # of items that are currently on order, then that would solve my problem 100%. If anyone knows of something like that, please let me know.
Thanks,
Wil