SilverCart\Model\Product\Product::addToCart
adds an product to the cart or increases its amount If stock managament is activated: -If the product's stock quantity is overbookable there are noc hanges in behaviour.
-If the stock quantity of a product is NOT overbookable and the $quantity is larger than the stock quantity $quantity will be set to stock quantity. -If the stock quantity of a product is NOT overbookable and the products stock quantity is less than zero false will be returned.
- Author: Sebastian Diel <sdiel@pixeltricks.de>, Sascha Koehler <skoehler@pixeltricks.de>, Roland Lehmann <rlehmann@pixeltricks.de>
Signature
public function addToCart(int
$cartID,
[integer
$quantity = 1,
[boolean
$increment = false]] )
Parameters
$cartID
— int- ID of the users shopping cart
$quantity
— integer- Amount of products to be added
$increment
— boolean- Set to true to increment the quantity instead
of setting it absolutely
Returns
- ShoppingCartPosition