public/wordpress/wp-content/plugins/wp-courseware/includes/controllers/subscriptions.php
/**
	 * Does the cart contain a subscription.
	 *
	 * @since 4.5.0
	 *
	 * @return bool $contains_subscription True if cart contains subscription.
	 */
Does the cart contain a subscription.

@return bool $contains_subscription True if cart contains subscription.
Does the cart contain a subscription . @return bool $contains_subscription True if cart contains subscription .
public function cart_contains_subscription() {
		$contains_subscription = false;
		$cart = wpcw()->cart->get_cart();
		if ( empty( $cart ) ) {
			return $contains_subscription;
		}
		foreach ( $cart as $cart_item_key => $cart_item ) {
			if ( ! isset( $cart_item['id'] ) || empty( $cart_item['data'] ) ) {
				continue;
			}
			$course = new Course( $cart_item['data'] );
			if ( $course->is_subscription() ) {
				$contains_subscription = true;
				break;
			}
		}
		return $contains_subscription;
	}
public function cart_contains_subscription ( ) { $ contains_subscription = false ; $ cart = wpcw ( ) -> cart -> get_cart ( ) ; if ( empty ( $ cart ) ) { return $ contains_subscription ; } foreach ( $ cart as $ cart_item_key => $ cart_item ) { if ( ! isset ( $ cart_item [ 'id' ] ) || empty ( $ cart_item [ 'data' ] ) ) { continue ; } $ course = new Course ( $ cart_item [ 'data' ] ) ; if ( $ course -> is_subscription ( ) ) { $ contains_subscription = true ; break ; } } return $ contains_subscription ; }
Does the cart contain a subscription.
Does the cart contain a subscription .