woocommerce_coupon_validate_expiry_date хук-фильтр . WC 3.2.0
Ensure coupon date is valid or throw exception.
Использование
add_filter( 'woocommerce_coupon_validate_expiry_date', 'filter_function_name_4832', 10, 3 ); function filter_function_name_4832( $coupon, $coupon, $that ){ // filter... return $coupon; }
- $coupon(WC_Coupon)
- Coupon data.
- $coupon
- -
- $that
- -
Список изменений
С версии 3.2.0 | Введена. |
Где вызывается хук
woocommerce_coupon_validate_expiry_date
woocommerce/includes/class-wc-discounts.php 686
if ( $coupon->get_date_expires() && apply_filters( 'woocommerce_coupon_validate_expiry_date', time() > $coupon->get_date_expires()->getTimestamp(), $coupon, $this ) ) {