Shopping Cart Management
We would like to design a webpage which will list the items in a shopping cart organized and categorized in various ways and allow the buyer to add or remove items interactively. The buyer can remove or add items from her shopping cart dynamically, and she can check the total price or the price of individual items in the cart at all times.
Again, the code is displayed against different background colors to differentiate the HTML and Javascript parts.
We use two trees in the same page, one to show the user's items in the cart, and one to show the available product categories. In a real situation, the code forĀ each tree would be created on the web server, using a server-side language like PHP and querying a database. For simplicity, in our example we include only the generated Javascript code.
» |