WC_Order::is_download_permitted()publicWC 1.0

Checks if product download is permitted.

Method of the class: WC_Order{}

Return

true|false.

Usage

$WC_Order = new WC_Order();
$WC_Order->is_download_permitted();

WC_Order::is_download_permitted() code WC 9.6.1

public function is_download_permitted() {
	/**
	 * Filter to check if an order is downloadable.
	 *
	 * @param bool     $is_download_permitted Is the order downloadable.
	 * @param WC_Order $this                  Order object.
	 * @since 2.7.0
	 */
	return apply_filters( 'woocommerce_order_is_download_permitted', $this->has_status( OrderStatus::COMPLETED ) || ( 'yes' === get_option( 'woocommerce_downloads_grant_access_after_payment' ) && $this->has_status( OrderStatus::PROCESSING ) ), $this );
}