adjusting inventory
What do I need to do to subtract the eCart quantity from "ProductQtyStock" in this product update?
(I corrected the original post; I had the "while" statement in the wrong position)
<?php
if ($_SESSION['eCartReceiptCompleted'] != true) {
$eCart1->MoveFirst();
while (!$eCart1->EOF()) {
$UpdateQuery = new WA_MySQLi_Query($auntbelles);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "products";
$UpdateQuery->bindColumn("ProductQtyStock", "d", "".$eCart1->DisplayInfo("Quantity") ."", "WA_DEFAULT");
$UpdateQuery->addFilter("ProductID", "=", "i", "".$eCart1->DisplayInfo("ID") ."");
$UpdateQuery->execute();
$eCart1->MoveNext();
}
$UpdateGoTo = "";
$eCart1->MoveFirst();
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>