File: D:/HostingSpaces/SBogers10/douven.komma.pro/app/KommaApp/Shop/Cart/ShoppingCartServiceInterface.php
<?php
namespace App\KommaApp\Shop\Cart;
use App\KommaApp\Shop\Discounts\DiscountableInterface;
/**
* Represents a shopping cart
*
* Class ShoppingCartService
* @package App\KommaApp\Shop\Cart
*/
interface ShoppingCartServiceInterface extends DiscountableInterface
{
/**
* Add a product in the cart
*
* @param int $id
* @param int $amount
* @return ShoppingCartItemInterface|null
*/
public function addProduct(int $id, int $amount = 1) : ?ShoppingCartItemInterface;
/**
* Deletes the ShoppingCartItem that has a product with the specified id
*
* @param int $id
* @return ShoppingCartServiceInterface
*/
public function deleteItem(int $id) : ShoppingCartServiceInterface;
/**
* Clears the shopping cart of all items
*
* @return ShoppingCartServiceInterface
*/
public function clear() : ShoppingCartServiceInterface;
/**
* Returns the sum of all base prices of products. This value is in cents
* If you specify the boolean argument as true it takes the CartModifiers into account
* Remember the base price is in cents.
*
* @param bool $includeDiscounts
* @return float
*/
public function getTotal(bool $includeDiscounts = true): float;
/**
* Returns the amount of items in the cart.
* If you specify the $unique argument as true it returns the number of ShoppingCartItems.
* If it is false it will return the sum of all products in all Shopping cart items
* If you specify the $includeCartModifiers argument as true it takes the CartModifiers into account
* @param bool $unique
* @param bool $includeModifiers
* @return int
*/
public function getItemsCount(bool $unique = false, bool $includeModifiers = true):int;
/**
* Get all shopping cart items
*
* @return ShoppingCartItemInterface[]
*/
public function getItems() : array;
}