Function Hook_ecommerce_catalogue_items->get_available_quantity
Definitions
sources/hooks/systems/ecommerce/catalogue_items.php
- Get currently available quantity of selected product.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: int
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $type_code | ID_TEXT | No | No | required parameter | N/A | N/A | The product codename |
| $consider_own_cart_contents | boolean | No | No | True | N/A | N/A | Whether to consider the contents of your own cart |
| $member_id | ?MEMBER | No | No | Null | N/A | N/A | The member we are checking against (null: current member) |
Returns
- Quantity (null: no limit)
- Type: ?integer
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get currently available quantity of selected product.
*
* @param ID_TEXT $type_code The product codename
* @param boolean $consider_own_cart_contents Whether to consider the contents of your own cart
* @param ?MEMBER $member_id The member we are checking against (null: current member)
* @return ?integer Quantity (null: no limit)
*/
public function get_available_quantity(string $type_code, bool $consider_own_cart_contents = true, ?int $member_id = null) : ?int
* Get currently available quantity of selected product.
*
* @param ID_TEXT $type_code The product codename
* @param boolean $consider_own_cart_contents Whether to consider the contents of your own cart
* @param ?MEMBER $member_id The member we are checking against (null: current member)
* @return ?integer Quantity (null: no limit)
*/
public function get_available_quantity(string $type_code, bool $consider_own_cart_contents = true, ?int $member_id = null) : ?int

