woocommerce_coupon_validate_expiry_date filter-hookWC 3.2.0

Ensure coupon date is valid or throw exception.

Usage

add_filter( 'woocommerce_coupon_validate_expiry_date', 'wp_kama_woocommerce_coupon_validate_expiry_date_filter', 10, 2 );

/**
 * Function for `woocommerce_coupon_validate_expiry_date` filter-hook.
 * 
 * @param  $coupon 
 * @param  $that   
 *
 * @return 
 */
function wp_kama_woocommerce_coupon_validate_expiry_date_filter( $coupon, $that ){

	// filter...
	return $coupon;
}
$coupon
-
$that
-

Changelog

Since 3.2.0 Introduced.

Where the hook is called

WC_Discounts::validate_coupon_expiry_date()
woocommerce_coupon_validate_expiry_date
woocommerce/includes/class-wc-discounts.php 690
if ( $coupon->get_date_expires() && apply_filters( 'woocommerce_coupon_validate_expiry_date', time() > $coupon->get_date_expires()->getTimestamp(), $coupon, $this ) ) {

Where the hook is used in WooCommerce

Usage not found.