Skip to content

aptivada/php-basic-assessment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic PHP Assessment

Cart Challenge / cart.php

Step 1)

Implement getProductById() We don't have a database, so we'll pretend that this method does a database lookup by product id, and returns the product row. It should:

  • take in a product id, NOT a numerical index of the products array
  • return the entire product, which contains id, title and price.
  • be used in Cart::addProduct()

Step 2)

Build Cart class Cart extends CartInterface. The CartInterface interface contains method-specific instructions.

Step 3)

Test by adding and removing multiple items to cart, experimenting with different quantities.
An example of this is commented out in index.php

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages