close ad
 
Important WebAssist Announcement
open ad
View Menu

Web development tutorial

Inventory management administration II

Tutorial created by Ray Borduin, WebAssist

Categories: Data Bridge, eCart, Dreamweaver, PHP

rating

In the second tutorial of the Inventory Management series, you will learn how to set up inventory control so that an Administrator can track and update the amount of stock available in an eCommerce site. 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.

arrow downWhat do you need to start?

  1. Site defined with Dreamweaver CS4 or higher.
  2. Product and admin pages built with DataAssist. For more assistance, view tutorials: Create a product catalog I and Create a product catalog II.
  3. A checkout experience previously generated with eCart 5 or higher.

arrow downCreate inventory update page

Keeping the ProductUpdateDate and ProductStock database fields in mind, your next step is to create a page that contains an inventory field where the Administrator can track and update the number of existing products in inventory as stock is replenished.

  1. Go to WebAssist > Database > DataAssist Pages to begin creating the inventory update page.

  2. In DataAssist: Create Pages, begin with the Page Settings tab.

  3. For the application type, select <New from Blank>.

  4. For Table, select products.

  5. For Key Column, select ProductID.


  6. Add a display to the inventory update page.

    1. Open the Manage Pages tab.

    2. Click the + icon to open the Add Selected to List window.

    3. Select Update and click OK.


    4. In DataAssist: Update Page, click the + icon, select ProductUpdateDate and.ProductStock. Click OK.


    5. Now that your columns are created, click OK once again.


    6. In DataAssist: Create Pages, using the folder icon, browse to the Admin folder and choose products_update.php.


    7. Rename the page admin/inventory_update.php and click Finish.


    8. Verify that inventory_update.php is now in your admin folder.


  7. In code view, update groupHeader from "Update" to "Update Inventory".


  8. In code view, replace one instance of "ProductStock" with "RemainingInventory" as indicated.


  9. To display the current date that inventory is updated, copy the following snippet of code (Ctrl or Cmd + C):
    <?php echo((isset($_GET["invalid"])?ValidatedField("inventoryupdate","ProductUpdateDate"):"".date("n/d/Y g:ia",time())).""); ?>

  10. Paste the snippet into "value" for ProductUpdateDate (Ctrl or Cmd + P):


  11. Copy the following snippet of code (Ctrl or Cmd + C):
    - (SELECT Coalesce(SUM(DetailQuantity),0) FROM orders Inner Join orderdetails ON orderdetails.DetailOrderID = orders.OrderID WHERE OrderDate > ProductUpdateDate AND DetailProductID = ProductID) AS RemainingInventory

  12. Locate the recordset. Place your cursor in the select statement after the ProductsStock column and paste the snippet (Ctrl or Cmd + P):

arrow downEdit product update page

While you are updating your products on your product update page, you may want to track and add to your products in stock. In this section, you will be adding a link on your product update page that leads to the inventory update page. You will also be adding a field to show the current inventory count so that you can check it without having to open the inventory update page.

  1. Open your administrative product update page.

  2. First copy the following snippet of code (Ctrl or Cmd +C):
    , ProductStock - (SELECT Coalesce(SUM(DetailQuantity),0) FROM orders Inner Join orderdetails ON orderdetails.DetailOrderID = orders.OrderID WHERE OrderDate > ProductUpdateDate AND DetailProductID = ProductID) AS RemainingInventory

  3. In code view, paste the code as indicated (Ctrl or Cmd +P):


  4. Now we will add both a counter that tracks inventory and a link that leads to inventory_update.php.

  5. In code view, enter In Stock and Update Inventory to position the text at the top of the page in preparation for the counter and link.


  6. To begin creating the counter, copy the following snippet of code (Ctrl or Cmd +C):
    <?php echo $row_WADAproducts['RemainingInventory'] ?>

  7. In code view, paste the code as indicated (Ctrl or Cmd +P):


  8. To begin creating the link, select "Update Inventory".


  9. In the Properties inspector, click the folder icon next to the Link field.


  10. In the Select File window, select the inventory_update page and click Parameters.


  11. In the Parameters window, click the + icon and under Name, type ProductID. Tab to Value and click the lightning bolt. (The lightning bolt does not show in the screenshot.)


  12. In the Dynamic Data window that opens, expand Recordset (WADAproducts), select ProductID, and click OK.


  13. In the Parameters window, you can now see the link in the Value field. Click OK.


  14. In the Select File window, click OK.


  15. Go to File > View in Browser > to view your product update page with the link that you just created. After the inventory count has been added to the ProductStock field, the actual number in stock will appear to the left of the link.

arrow downTrack and update inventory

Now you will be able to track the number in stock (on both product update and inventory update pages) and update the inventory count (on inventory update page) when you increase the number of any given product in stock.

  1. Go to File > View in Browser > to view your product update page. (The actual number in stock will appear to the left of the Update Inventory link after the inventory count has been added.)


  2. Click the Update Inventory link on the product update page to open the inventory update page.


  3. The current date will populate automatically in the ProductUpdateDate field. However, the date can also be manually adjusted.

  4. For now, take note of the ProductStock field which will reflect the current amount of product in stock. This is also where the inventory count will be updated. (We will be addressing this further in the series.)

arrow downWhere do you go next?

Now that you know the inventory workflow and how to set up inventory control, you will learn how to inform your online customers on the product detail page when the product they wish to purchase is no longer available at Inventory management product detail III.

arrow downWebAssist inventory management series

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.

  1. Inventory management series: A summary of six in-depth tutorials which walk you through the steps of managing inventory on your eCommerce site using administrative pages as well as product detail, shopping cart and confirm pages.

  2. Inventory management introduction I: Learn about inventory control for eCommerce sites and how to set up your database to manage product stock.

  3. Inventory management administration II: Learn how to set up inventory control so that an Administrator can track and update the amount of stock carried in an eCommerce site.

  4. Inventory management product detail III: Learn how to alert online customers to insufficient inventory on the product detail page for the product they wish to purchase.

  5. Inventory management shopping cart IV: Learn how to alert online customers to insufficient inventory in the shopping cart for the product they wish to purchase.

  6. Inventory management checkout V: Learn how to alert online customers during checkout to insufficient inventory for the product they wish to purchase.

  7. Inventory management workflow VI: In this final tutorial, you will be walked through the inventory management workflow process from start to finish.


For further inventory management help, check our Community Forums or post comments to this tutorial.

arrow downReviews and comments

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 comments
rating

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.