HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/vangogh.komma.pro/app/Komma/Shop/Cart/ShoppingCartServiceInterface.php
<?php

namespace App\Komma\Shop\Cart;
use App\Komma\Shop\Discounts\DiscountableInterface;
use App\Komma\Shop\Products\ProductableInterface;


/**
 * Represents a shopping cart
 *
 * Class ShoppingCartService
 * @package App\Komma\Shop\Cart
 */
interface ShoppingCartServiceInterface extends DiscountableInterface
{
    /**
     * Add a product in the cart
     *
     * @param ProductableInterface $productable
     * @param int $amount
     * @return ShoppingCartItemInterface|null
     */
    public function addProductable(ProductableInterface $productable, int $amount = 1) : ?ShoppingCartItemInterface;

    /**
     * Deletes the ShoppingCartItem that has a product with the specified id
     *
     * @param ProductableInterface $productable
     * @return ShoppingCartServiceInterface
     */
    public function deleteItem(ProductableInterface $productable) : 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;
}