as posts by 'angora' disappeared and with it the solution i used, i put the solution here again:
make a file called "ProductSale.php" in /override/classes/ with following code:
<?php
class ProductSale extends ProductSaleCore
{
// called for each product contained within an order, when an order's status is marked 'logable' (aka verified/paid)
static public function addProductSale($product_id, $qty = 1)
{
$goober = Db::getInstance()->Execute('
INSERT INTO '._DB_PREFIX_.'product_sale
(`id_product`, `quantity`, `sale_nbr`, `date_upd`)
VALUES ('.(int)($product_id).', '.(float)($qty).', 1, NOW())
ON DUPLICATE KEY UPDATE `quantity` = `quantity` + '.(float)($qty).', `sale_nbr` = `sale_nbr` + 1, `date_upd` = NOW()'
);
// check remaining product quantity subsequent to the sale transaction and, if sold out, set product.active=0 (aka disabled/draft, does not display in catalog)
$smurf = Db::getInstance()->getValue('SELECT `quantity` from `'._DB_PREFIX_.'product` WHERE `id_product` = '.(int)$product_id);
if ($smurf <= 0 )
{
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product` SET `active` ='. (int)0 .' WHERE `id_product` = '.(int)$product_id);
}
return $goober;
}
}
?>
that worked for me on 1.4