js-munich-2020-spring

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.

  1. Add an “amount” property to each product.
  2. When amount is greater than 3 do not display any additional info
  3. When amount value is 3 or less display “almost out of stock” message next to product
  4. When amount is 1 display “last chance”
  5. When amount is 0, either do not display product at all or display “out of stock” next to it
  6. 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