LLMS_Analytics::get_total_coupon_amount( [array] $orders )

Get dollar value of coupons used


Description Description


Parameters Parameters

$orders

([array]) (Required) [array of order objects]


Top ↑

Return Return

([int]) [total $ coupons used]


Top ↑

Source Source

File: includes/class.llms.analytics.php

	public static function get_total_coupon_amount( $orders ) {

		$coupons = 0;

		if ( $orders ) {

			foreach ( $orders as $order ) {

				if ( ! empty( $order->coupon_id ) ) {

					//calculate coupon
					$product = new LLMS_Product( $order->id );
					$coupons += $product->get_coupon_discount_total( $order->order_total );

				}
			}
		}

		return $coupons;
	}


Top ↑

User Contributed Notes User Contributed Notes

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