4.17 A SHOPPING CART TABLE SORT EXAMPLE

A shopping cart is a non-trivial utility that is a part of any eCommerce system. There are multiple implementations possible, in practice, each depending in turn on the domain or the items that are being sold. Essentially, it is represented by a table which contains the items that are shopped, a field for quantity and then a field for price. In practice there could be a few more columns for amounts, and a few extra methods (or operations) apart from adding/removing/modifying the items in the cart. For now, assume a very simple set of columns arranged in the form of a table. The point is to demonstrate the dynamic construction of elements of the cart, viz. the table header, its format and its rows (representing ...

Get Web Technology: Theory and Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.