close ad
 
Important WebAssist Announcement
open ad
View Menu

Web development tutorial

Inventory management introduction I

Tutorial created by Ray Borduin, WebAssist

Categories: Data Bridge, eCart, Dreamweaver, PHP

rating

In the first tutorial of the Inventory Management series, you will be introduced to inventory control for eCommerce sites in a helpful overview. Additionally, you will learn how to set up your database and prepare the administrative product update page for inventory control. 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 downInventory management overview

To understand the steps you will be taking in this tutorial, let's start with an overview of inventory management.

  1. When the administrator enters the number in inventory for a given product on the admin inventory update page, the number and current date are inserted into the products table in the database.

    1. For example, if there are 100 pairs of shoes in stock, the administrator would enter 100.

  2. When a customer purchases that product, the quantity purchased is inserted into the orders table of the database.

  3. When the administrator returns to the inventory update page, the current number in stock will be displayed in the inventory field by making this calculation: (Number in inventory of the given product entered by admin) - (Number sold since the stock date) = Current number in stock.

    1. For example, there are 100 pairs of shoes in inventory and a customer buys 1 pair. At a glance, an administrator can see that 99 items remain in inventory by viewing either the product update page or the inventory update page.


arrow downSet up your database

Two database fields that are necessary to inventory management are ProductUpdateDate and ProductStock.

  1. ProductUpdateDate: A time-stamped field that reflects the date you last updated your inventory.

  2. ProductStock: The number of items in stock on the date you last added to your inventory.


  3. If these two fields are not currently in the products table of your database:

    1. Go to your database and open the products table.


    2. Insert a column, naming it ProductUpdateDate. The type of field is Date/Time.

    3. Insert a second column, naming it ProductStock. The type of field is Integer (for whole numbers) or Double (for decimals).

arrow downPrepare product update page

In the second tutorial of the Inventory Management series, you will be creating an inventory update page to track and update inventory. On it, you will be adding two fields, ProductUpdateDate and ProductStock, both of which occur on products_update.php created with the DataAssist: Create Pages wizard. Therefore, these two fields should be removed from products_update.php. Also, the ProductUnlimited column should be removed from products_update.php since it is assumed that unlimited inventory would not require inventory management.

This section can be skipped if you did not use the Data Bridge preset to create your Recordsets and pages.


The optimal time to remove the three columns is when you are creating pages using the DataAssist: Create Pages wizard. (For assistance, refer to "What Do You Need to Start?" in this tutorial.)

  1. In Dreamweaver, go to WebAssist > Database > DataAssist Pages.

  2. In the Page Settings tab, choose Product Administration for Application Type, Products for Table, and ProductID for Key Column.


  3. In the Manage Pages tab, select admin/products_update.php and click the second pencil icon to make changes.


  4. Customize products_update.php by selecting ProductUpdateDate and deleting the column by clicking on the trash icon. Repeat for ProductStock and ProductUnlimited.


  5. Click OK and Finish to rebuild the product update page.


Or you can also delete the columns directly from products_update.php in code view if you already created your pages.

  1. For ProductUpdateDate (Update Date), remove:
    <div class="lineGroup"> <label for="ProductUpdateDate" class="sublabel" > Update Date:</label>
    <input id="ProductUpdateDate" name="ProductUpdateDate" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("productsupdate","ProductUpdateDate"):"".(($row_WADAproducts["ProductUpdateDate"])?date("n/d/Y",strtotime($row_WADAproducts["ProductUpdateDate"])):"")."")); ?>" class="formTextfield_Medium" tabindex="9" title="Please enter a value.">
    <?php
    if (ValidatedField('productsupdate','productsupdate')) {
    if ((strpos((",".ValidatedField("productsupdate","productsupdate").","), "," . "6" . ",") !== false || "6" == "")) {
    if (!(false)) {
    ?><span class="serverInvalidState" id="ProductUpdateDate_ServerError">Please enter a value.</span><?php //WAFV_Conditional products_update.php productsupdate(6:)
    }
    }
    }?>
    </div>

  2. For ProductStock (Number in Stock), remove:
    <div class="lineGroup"> <label for="ProductStock" class="sublabel" > Number In Stock:</label>
    <input id="ProductStock" name="ProductStock" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("productsupdate","ProductStock"):"".$row_WADAproducts["RemainingInvetory"]."")); ?>" class="formTextfield_Medium" tabindex="12" pattern="[\+\-]?[0-9]+([\.,][0-9]+)?([eE]{0,1}[\-\+]?[0-9]+)?" title="Please enter a value.">
    <?php
    if (ValidatedField('productsupdate','productsupdate')) {
    if ((strpos((",".ValidatedField("productsupdate","productsupdate").","), "," . "9" . ",") !== false || "9" == "")) {
    if (!(false)) {
    ?><span class="serverInvalidState" id="ProductStock_ServerError">Please enter a value.</span><?php //WAFV_Conditional products_update.php productsupdate(9:)
    }
    }
    }?>
    </div>

  3. For ProductUnlimited (Unlimited Availability), remove:
    <div class="lineGroup"> 
    <label class="checklabel" for="ProductUnlimited"><input type="checkbox" name="ProductUnlimited" id="ProductUnlimited" value="1" class="formCheckboxField_Standard" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("productsupdate","ProductUnlimited"):"".$row_WADAproducts["ProductUnlimited"].""),"1"))) {echo "checked=\"checked\"";} ?> tabindex="14" title="Please enter a value.">&nbsp;Unlimited Availability</label>
    </div>

  4. Now when you view products_update.php in your browser (File > Preview in Browser), note that the three columns...


  5. have been removed...

arrow downWhere do you go next?

Now that you have completed the inventory management introduction, learn how to set up inventory control so that an Administrator can track and update the amount of stock carried in an eCommerce site at Inventory management administration II.

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

Eche: 9 Years, 9 Months, 4 Days, 6 Hours, 2 Minutes ago

Hi Kate. Please do you help individuals develop and design website? Please will like to know. Thanks

Kate Ford: 9 Years, 9 Months, 4 Days, 5 Hours, 12 Minutes ago

Hi Eche, No, not at this time. But thank you for asking. Kate

Team WebAssist: 9 Years, 9 Months, 4 Days, 5 Hours, 11 Minutes ago

Eche, feel free to visit our Developers page (from the Community menu) and contact developers that work with our products.

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.