Filter the results of the discount code check. This can be used to add additional programmatic requirements to a discount code being used. Return true if discount code is okay to use. Return false or a string containing the error text if the discount code is not okay to use.
$pmpro_check_discount_code = apply_filters("pmpro_check_discount_code", bool $okay, object $dbcode, int $level_id, string $code);
- bool; True if discount code check is okay. False is there was an error.
- Object; containing code data from database row.
- int; Level the user is checking out for.
- string; Discount code string.
SourceView in Source Code
Related Articles and Recipes
Restrict Discount Code Usage to One Time Per User By Kimberly Coleman