WC_Discounts::validate_coupon_expiry_date( WC_Coupon $coupon )

Ensure coupon date is valid or throw exception.


Description Description


Parameters Parameters

$coupon

(Required) Coupon data.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/class-wc-discounts.php

	protected function validate_coupon_expiry_date( $coupon ) {
		if ( $coupon->get_date_expires() && apply_filters( 'woocommerce_coupon_validate_expiry_date', time() > $coupon->get_date_expires()->getTimestamp(), $coupon, $this ) ) {
			throw new Exception( __( 'This coupon has expired.', 'woocommerce' ), 107 );
		}

		return true;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.2.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.