Blood test packs

You are creating an e-commerce shop for a medical lab, where clients can buy various blood tests. Each test has a fixed price, and your task is to suggest a test pack so that client can save money.

Requirements:

  • Display a list of blood tests (bloodTests variable) from the data file.
  • Each blood test item should display the test name and the price.
    For example: Complete blood count $5.
  • Add proper test attributes to <label> elements. If the test id is 4, set data-test="test-4". Refer to the provided html code.
  • It should be possible to check and uncheck tests. By default, all checkboxes should be unchecked.
  • Display the total price of all selected tests.
  • Try to suggest a pack. A pack should be suggested if buying this pack would reduce the price.
    For example:
    User selected: LDL ($10), TSH ($15), FT3 ($15).
    Total is $40.
    If user buys LDL ($10) + Thyroid pack ($25), he will pay $35, and save $5.
  • If multiple packs can be suggested, display the one with the biggest saving value.
  • Packs are defined in the bloodPacks variable in the data file.
  • If no pack can be suggested, display - (suggested pack) and $0 (save).

You are free to add classes, styles, ids, but don't edit or remove data-test attributes.
Create an account to start coding
Create account