Function Hook_ecommerce_email->is_available
Definitions
sources/hooks/systems/ecommerce/email.php
- Check whether the product codename is available for purchase by the member.
- 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 |
| $member_id | MEMBER | No | No | required parameter | N/A | N/A | The member we are checking against |
| $req_quantity | integer | No | No | 1 | N/A | N/A | The number required |
| $must_be_listed | boolean | No | No | False | N/A | N/A | Whether the product must be available for public listing |
Returns
- The availability code (a ECOMMERCE_PRODUCT_* constant)
- Type: integer
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Check whether the product codename is available for purchase by the member.
*
* @param ID_TEXT $type_code The product codename
* @param MEMBER $member_id The member we are checking against
* @param integer $req_quantity The number required
* @param boolean $must_be_listed Whether the product must be available for public listing
* @return integer The availability code (a ECOMMERCE_PRODUCT_* constant)
*/
public function is_available(string $type_code, int $member_id, int $req_quantity = 1, bool $must_be_listed = false) : int
* Check whether the product codename is available for purchase by the member.
*
* @param ID_TEXT $type_code The product codename
* @param MEMBER $member_id The member we are checking against
* @param integer $req_quantity The number required
* @param boolean $must_be_listed Whether the product must be available for public listing
* @return integer The availability code (a ECOMMERCE_PRODUCT_* constant)
*/
public function is_available(string $type_code, int $member_id, int $req_quantity = 1, bool $must_be_listed = false) : int

