PHP Интерфейс WC_Coupon_Data_Store_Interface

Functions that must be defined by coupon store classes.
Автор: WooThemes
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Описание методов

decrease_usage_count() публичный Метод

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() публичный Метод

Return a coupon code for a specific ID.
public get_code_by_id ( integer $id ) : string
$id integer
Результат string Coupon Code

get_ids_by_code() публичный Метод

Can return multiple to check for existence.
public get_ids_by_code ( string $code ) : array
$code string
Результат array Array of IDs.

get_usage_by_user_id() публичный Метод

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
Результат integer

increase_usage_count() публичный Метод

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