rcp_get_discount_by()

Note: This is part of the developer docs and is considered custom code.
Unfortunately, we cannot provide support for custom code at this time as we do not have the additional resources that would be necessary to provide support for custom code. 

If you need assistance with this, please reach out to our list of consultants for further assistance:
https://codeable.io/developers/restrict-content-pro/
Retrieves a single discount record by a column/value combo.
Parameters:

$column_name (string) – Name of the column.
$column_value (mixed) – Value of the column.

Return values:

RCP_Discount object on success.
false on failure.

Introduced: Version 3.3.
Example:
Retrieve a discount by the code “beta_tester”.
$discount = rcp_get_discount_by( ‘code’, ‘beta_tester’ );

Have more questions?

Submit a request