Posted by gordon on September 21, 2007 at 2:15am
I finished this today proper stock control from e-Commerce. It has all the features that I want and should stop sites from overselling products.
The list of features are:
- Temporary stock allocation
- Checking of stock allocations to make sure they are not over allocated.
- Stock reservations for items that have been sold, but not yet shipped.
- Reversal of stock committing when a transaction is canceled.
The other good thing is that this doesn't just apply to tangible products, but can also be used on things like Training courses and seminars where there is limited places.
I have also dropped alpha3 which also has a lot of bug fixes as well.

Comments
install script for store (alpha3)
Hi,
when trying to do the upgrade from existing v3 to v4a3 update script stuck.
found that in function store_update_5402 the select for total should use distinct :
<?php$_SESSION['store_update_5402_total'] = db_result(db_query('SELECT distinct COUNT(uid) FROM {ec_transaction} WHERE uid > 0 AND ecid = 0 GROUP BY uid'));
?>
then it continue to update.
This is because later the update is per UID and not per row.
<?phpdb_query('UPDATE {ec_transaction} SET ecid = %d WHERE uid = %d', $customer->ecid, $txn->uid);
?>
also duplicate functions :
function store_update_5404
function store_update_5409
are doing the same thing.
Thanks I have fixed
Thanks I have fixed this.
But in future we really need these posted as an issue or they can be missed.
--
Gordon Heydon
OK
I will open an issue about it since I think my solution is not complete.