$cart->validateStock()
Makes sure no product is in the list more often than its stock allows
$cart->validateStock(null|Wagnerwagner\Merx\ProductPage $page = null): Wagnerwagner\Merx\ProductList
Parameters
| Name | Type | Default |
|---|---|---|
$page |
null or ProductPage |
null |
Return type
Exceptions
| Type | Description |
|---|---|
Exception |
error.merx.cart.soldOut when a product is sold out |
Exception |
error.merx.cart.stock when a product exceeds its stock |
Description
The lines of a product are added up first, so a product with one line per
name cannot get past its stock one name at a time.
Parent class
Wagnerwagner\Merx\Cart inherited from Wagnerwagner\Merx\ProductList