I've hacked QC 0.3.1 to include product stock, but I need directions how to convert it to a stock plugin.
I looked at a few plugins but I get confused because in some you put files in both a plugin directory and in the normal file structure of QC. In some you need to patch a couple of files by hand. I need a best practise example.
---
Below is a brief list of my changes:
/actions_admin/products.php . added a few lines
/core/orders-admin.php . saveOrderStatus() modified . cancelStock() new function
i have some warnings: - never please never do replacement functions. now you replace: saveOrder, listBasket, dbAddBasketProduct, throwProduct, dbThrowProduct, dbChangeProduct ... and many other basic and important functions. this create problem that this plugin will not run with other plugins - i have 10 units of my 1 product. 1 people add this 10 units to basket and never finish order. what will happen with this 10 units. it will be still reserved ... ? - i suggest to save stock in other file like db/products_stock.php ... not in the db/products.php file
Rickard
2005-11-04 23:15
Great! Finally some guidelines how to write plug-ins. - OK. Replacement functions is a problem but only if more than one plug-in uses it. is this what you mean treewood? - Adding 10 units to basket does not mean that you reserve them. They are reserved when you finish your order. If stock has decreased below 10 during your time browsing around in the web shop you will get the new lower number of units in stock when you finish the order. I don't think this is a big issue though. - ok
rickard - most people install more then only one plugin - then what if first one add to basket 10 units of product (we have in stock 10 units) and browse other products and second one add to basket 10 units of the same product. what will plugin do when them finish orders? i think better is reserve product when someone add it to basket but problem is that how to retrieve products from unfinished orders
witaj.net
Digital Backups
2005-11-06 02:52
So treewood, are you saying this plugin wont work with other plugins, like those from Wizzud because he used "replacement function" ? If so, how can that problem be resolved.
Personally I can deal with the problems of "What If" two people order at the same time.
PS: Great work you guys have done with QuickCart ! !
Shadowed
2006-10-29 13:14
Nice work, but is there a corrected plugin for stock control ?