Auto Deduct Inventory
Hi, I now have all of my products auto deducting from the database except for when there are different colors and sizes for the shopper to choose from. This is all being done from the "Checkout_Success" page.
I am pasting the code that is allowing me to do this and I am hoping someone can help me with my size/color issue.
<?php
//WA eCart Show If Start
if (!$ecart1->IsEmpty()) {
?>
<h2>Order Receipt</h2>
<h3 class="eCart_OrderHeaderInfo">Order number: <?php echo ((isset($_SESSION["ecart1_OrderID"]))?$_SESSION["ecart1_OrderID"]:"") ?></h3>
<p class="eCart_OrderHeaderInfo">Thank you for your order. Please allow 5 - 7 business days for delivery.</p>
<table class="eC_ShoppingCart" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>Name</th>
<th>Description</th>
<th>Item#</th>
<th>Size</th>
<th>Color</th>
<th class="eC_PriceItem" >Price</th>
<th class="eC_FormItem" >Quantity</th>
<th class="eC_PriceItem" >Total</th>
<th>Personal/Business</th>
</tr>
<?php
while (!$ecart1->EOF()) {
?>
<tr>
<td><?php echo $ecart1->DisplayInfo("Name"); ?></td>
<td><?php echo $ecart1->DisplayInfo("Description"); ?></td>
<td><?php echo $ecart1->DisplayInfo("ID"); $idCall = $ecart1->DisplayInfo("ID");?>
<td><?php echo $ecart1->DisplayInfo("Size"); ?></td>
<td><?php echo $ecart1->DisplayInfo("Color"); ?></td>
<td class="eC_PriceItem" ><?php echo WA_eCart_DisplayMoney($ecart1, $ecart1->DisplayInfo("Price")); ?></td>
<td class="eC_FormItem" ><?php echo $ecart1->DisplayInfo("Quantity"); $solditems = $ecart1->DisplayInfo("Quantity") ?></td>
<td class="eC_PriceItem" ><?php echo WA_eCart_DisplayMoney($ecart1, $ecart1->DisplayInfo("TotalPrice")); ?></td>
<td class="eC_FormItem" ><?php echo $ecart1->DisplayInfo("Personal"); ?></td>
<?php
mysql_select_db($database_rsmyconnect, $rsmyconnect);
$query_itemQ = "Update inventory SET inventory.itemQty = inventory.itemQty -
$solditems WHERE inventory.itemId = $idCall";
$itemQ = mysql_query($query_itemQ, $rsmyconnect) or die(mysql_error());
?>
</tr>
<?php
$ecart1->MoveNext();
}
$ecart1->MoveFirst();
?>
Thanks!