WooCommerce Code Reference

WC_Coupon_Data_Store_Interface

Coupon Data Store Interface

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
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

Can return multiple to check for existence.

Parameters
$code : string

Coupon code.

Return values
arrayArray of IDs.