Noptin_WooCommerce::get_order_count( $customer_id_or_email )


Source Source

File: includes/integrations/class-noptin-woocommerce.php

	public function get_order_count( $customer_id_or_email ) {

		if ( empty( $customer_id_or_email ) ) {
			return 0;
		}

		if ( is_numeric( $customer_id_or_email ) ) {
			return (int) wc_get_customer_order_count( $customer_id_or_email );
		}

		$orders = wc_get_orders(
			array(
				'limit'         => -1,
				'billing_email' => $customer_id_or_email,
				'return'        => 'ids',
				'status'        => array_keys( wc_get_order_statuses() ),
			)
		);

		return count( $orders );

	}

Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation