Sunnysideup\Ecommerce\Api\ShoppingCart::addBuyable
Adds any number of items to the cart.
Returns the order item on succes OR false on failure.
Signature
public function addBuyable(BuyableModel
$buyable,
[float
$quantity = 1.00,
[array
$parameters = ]] )
Parameters
$buyable
— Sunnysideup\Ecommerce\Interfaces\BuyableModel- - the buyable (generally a product) being added to the cart
$quantity
— float- - number of items add
$parameters
— array- - array of parameters to target a specific order item. eg: group=1, length=5
if you make it a form, it will save the form into the orderitem
returns null if the current user does not allow order manipulation or saving (e.g. session disabled)
Returns
- bool|OrderItem