Automattic\WooCommerce\StoreApi\Utilities

CartController::get_cart_coupons()publicWC 1.0

Returns all applied coupons.

Method of the class: CartController{}

No Hooks.

Return

Array.

Usage

$CartController = new CartController();
$CartController->get_cart_coupons( $callback );
$callback(callable)
Optional callback to apply to the array filter.
Default: null

CartController::get_cart_coupons() code WC 9.3.3

public function get_cart_coupons( $callback = null ) {
	$cart = $this->get_cart_instance();
	return $callback ? array_filter( $cart->get_applied_coupons(), $callback ) : array_filter( $cart->get_applied_coupons() );
}