WordPress at Your Fingertips
function is not described

WC_Cart::get_coupons() public WC 1.0

Get array of applied coupon objects and codes.

{} It's a method of the class: WC_Cart{}

No Hooks.

Return

Array. of applied coupons

Usage

$WC_Cart = new WC_Cart();
$WC_Cart->get_coupons( $deprecated );
$deprecated(null)
No longer used.
Default: null

Code of WC_Cart::get_coupons() WC 5.6.0

public function get_coupons( $deprecated = null ) {
	$coupons = array();

	if ( 'order' === $deprecated ) {
		return $coupons;
	}

	foreach ( $this->get_applied_coupons() as $code ) {
		$coupon           = new WC_Coupon( $code );
		$coupons[ $code ] = $coupon;
	}

	return $coupons;
}