PHP Interface WC_Coupon_Data_Store_Interface

Functions that must be defined by coupon store classes.
Author: WooThemes
Afficher le fichier Open project: woocommerce/woocommerce

Méthodes publiques

Méthode Description
decrease_usage_count ( &$coupon, string $used_by = '' ) Decrease usage count for current coupon.
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.

Method Details

decrease_usage_count() public méthode

Decrease usage count for current coupon.
public decrease_usage_count ( &$coupon, string $used_by = '' )
$used_by string Either user ID or billing email

get_code_by_id() public méthode

Return a coupon code for a specific ID.
public get_code_by_id ( integer $id ) : string
$id integer
Résultat string Coupon Code

get_ids_by_code() public méthode

Can return multiple to check for existence.
public get_ids_by_code ( string $code ) : array
$code string
Résultat array Array of IDs.

get_usage_by_user_id() public méthode

Get the number of uses for a coupon by user ID.
public get_usage_by_user_id ( &$coupon, id $user_id ) : integer
$user_id id
Résultat integer

increase_usage_count() public méthode

Increase usage count for current coupon.
public increase_usage_count ( &$coupon, string $used_by = '' )
$used_by string Either user ID or billing email