To add items to the cart, you need to implement the Addable interface, there are 3 methods to be dened:
public function getPrice();
public function getAvailableQty();
public function getCode();
The rst method returns a oat, for example ( 24.39), the second one returns an integer and the third a string. This code must be unique, it could be an id eld of a MySQL table or the product code itself.
Look at the example.php to get more infos.
To add an item to the cart, use:
$cart->addItem($product);
You can also set a dened quantity, if the quantity is not available for that product, the cart will set the maximum available quantity for the item: