In the third tutorial of the Inventory Management series, you will learn how to inform your online customers on the product detail page when the quantity of the product they wish to purchase is no longer available. When you are finished, follow the link to complete the next step in inventory management. A list of Inventory Management tutorials is also found at the bottom of this page.
Now you will update the public product detail page to let your customers know when a product they wish to purchase is no longer available. This is done by adding two snippets of code. In this section, we will add the first snippet to update the Recordset.
, ProductStock - (SELECT Coalesce(SUM(DetailQuantity),0) FROM orders Inner Join orderdetails ON orderdetails.DetailOrderID = orders.OrderID WHERE OrderDate > ProductUpdateDate AND DetailProductID = ProductID) AS RemainingInventory
Now you will add a message that will replace the Add to Cart button and alert the customer when a product is no longer available for purchase. This is done by wrapping an if statement around the Add to Cart button.
<?php if ($row_WADAproducts['RemainingInventory'] > 0) { ?>
<input type="hidden" name="ProductID" value="<?php echo($_GET['ProductID']); ?>">
<?php } else { ?>
out of stock
<?php
}
?>
Now that you've added a message on the product detail page to inform your online customers when the product they wish to purchase is no longer available, you will learn how to alert them in the shopping cart page at Inventory management shopping cart IV.
In the WebAssist inventory management series for eCommerce sites, you will learn how to track and update inventory as an administrator. Additionally, you will learn how to inform your customers throughout the shopping and purchase process when the quantity of the product they wish to purchase is insufficient or no longer in stock.
For further inventory management help, check our Community Forums or post comments to this tutorial.
Comments will be sent to the author of this tutorial and may not be answered immediately. For general help from WebAssist, please visit technical support.
Sign in to add commentsYour friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.
Dave W: 10 Years, 5 Months, 4 Weeks, 1 Day, 18 Hours, 23 Minutes ago
Parts IV, V, VI don't appear to exist!
Kate Ford: 10 Years, 5 Months, 2 Weeks, 6 Days, 11 Hours, 17 Minutes ago
Hi Dave, The remaining three tutorials, as well as an overview to the series, are now complete and waiting review before they can be published. ~ Kate