프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$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 |