LLMS_Coupon::get_uses()

Get the number of times the coupon has been used


Return Return

(int)


Top ↑

Source Source

File: includes/models/model.llms.coupon.php

	public function get_uses() {

		$query = new WP_Query(
			array(
				'meta_query'     => array(
					array(
						'key'   => $this->meta_prefix . 'coupon_code',
						'value' => $this->get( 'title' ),
					),
				),
				'post_status'    => 'any',
				'post_type'      => 'llms_order',
				'posts_per_page' => -1,
			)
		);

		return $query->post_count;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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