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]
Return Return
([int]) [total $ coupons used]
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; }
Expand full source code Collapse full source code View on GitHub