I want to do it where if I click the Add to Cart button, the product, with this detail:
Hazelnut, P30 x 5..................................P150
(Please ignore the .........., it should be a space) This should appear below. Since it is like a Bill. It should handle multiple text since the user will pick the item/s they want to add in the cart.
Then the Total Amount of Products, the Amount the Customer Pay and the Change should also appear below the List.
Then the stocks of each product should also be subtracted/updated.
I think I will be creating a new list for the AddToCart, but I do not know how I can make the bill/list part. Also the Total Amount to pay, the Amount the Customer Paid, and also the Change.
You can use @ABG 's sample, use many namespace to store data.
or you can use just one namespace, and store all data list in several tags.
In your blocks, you already have a prodList, then add some more like stocks/ carts/ orders.
then it's only some work to operate the lists (add, remove, replace, select).
everytime you changed the list, remember to save it to tinyDB.