Свойство | Тип | Описание | |
---|---|---|---|
$internal_meta_keys | array | Data stored in meta keys, but not considered "meta" for a coupon. | |
$meta_type | string | Internal meta type used to store coupon data. |
Метод | Описание | |
---|---|---|
create ( &$coupon ) | Method to create a new coupon in the database. | |
decrease_usage_count ( &$coupon, string $used_by = '' ) | Decrease usage count for current coupon. | |
delete ( &$coupon, array $args = [] ) | Deletes a coupon from the database. | |
get_code_by_id ( integer $id ) : string | Return a coupon code for a specific ID. | |
get_ids_by_code ( string $code ) : array | Return an array of IDs for for a specific coupon code. | |
get_usage_by_user_id ( &$coupon, id $user_id ) : integer | Get the number of uses for a coupon by user ID. | |
increase_usage_count ( &$coupon, string $used_by = '' ) | Increase usage count for current coupon. | |
read ( &$coupon ) | Method to read a coupon. | |
update ( &$coupon ) | Updates a coupon in the database. |
Метод | Описание | |
---|---|---|
update_post_meta ( $coupon ) | Helper method that updates all the post meta for a coupon based on it's settings in the WC_Coupon class. |
public decrease_usage_count ( &$coupon, string $used_by = '' ) | ||
$used_by | string | Either user ID or billing email |
public get_code_by_id ( integer $id ) : string | ||
$id | integer | |
Результат | string | Coupon Code |
public get_ids_by_code ( string $code ) : array | ||
$code | string | |
Результат | array | Array of IDs. |
public get_usage_by_user_id ( &$coupon, id $user_id ) : integer | ||
$user_id | id | |
Результат | integer |
public increase_usage_count ( &$coupon, string $used_by = '' ) | ||
$used_by | string | Either user ID or billing email |
protected array $internal_meta_keys | ||
Результат | array |
protected string $meta_type | ||
Результат | string |