LLMS_Analytics::get_orders( $values )


Description Description


Source Source

File: includes/class.llms.analytics.php

	public static function get_orders( $values ) {

		$args = array(
		  'post_type' 		=> 'llms_order',
		  'posts_per_page'	=> 5000,
		  'meta_query' 		=> array(),
		);

		if ( count( $values ) > 1 ) {
			$args['meta_query']['relation'] = 'AND';
		}

		foreach ( $values as $key => $value ) {
			$args['meta_query'][] = array(
		      'key' => $value['key'],
		      'value' => $value['value'],
		      'compare' => $value['compare'],
			);
		}

		$orders = get_posts( $args );

		$orders_data = array();

		foreach ( $orders as $key => $value ) {

			$order = LLMS_Product::get_order_data( $value->ID );
			array_push( $orders_data, $order );

		}

		return $orders_data;
	}


Top ↑

User Contributed Notes User Contributed Notes

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