Homework 10 – Store
Keep working on your little online store prototype and practice conditions.
Important: do not forget to do your homework on a separate branch with meaningful name
Spec
We going to add some extra functionality to your online store.
- Add an “amount” property to each product.
- When amount is greater than 3 do not display any additional info
- When amount value is 3 or less display “almost out of stock” message next to product
- When amount is 1 display “last chance”
- When amount is 0, either do not display product at all or display “out of stock” next to it
- Make sure that all 4 cases are covered (n>3, 3>=n>1, n==1, n<1)
Bonus:
Link amount functionality to ‘add to cart’ function. Change amount dynamically when product is added to cart.
Deadline
Saturday 18:00 08.05.2020
Lecture slides
Lesson 10 - Conditions