WooCommerce Code Reference

WC_Coupon_Data_Store_Interface

WC Coupon Data Store Interface

Functions that must be defined by coupon store classes.

Tags
version
3.0.0

Table of Contents

decrease_usage_count()  : mixed
Decrease usage count for current coupon.
get_code_by_id()  : string
Return a coupon code for a specific ID.
get_ids_by_code()  : array<string|int, mixed>
Return an array of IDs for for a specific coupon code.
get_usage_by_user_id()  : int
Get the number of uses for a coupon by user ID.
increase_usage_count()  : mixed
Increase usage count for current coupon.

Methods

get_ids_by_code()

Return an array of IDs for for a specific coupon code.

public get_ids_by_code(string $code) : array<string|int, mixed>

Can return multiple to check for existence.

Parameters
$code : string

Coupon code.

Return values
array<string|int, mixed>Array of IDs.