Automattic\WooCommerce\StoreApi\Utilities
CartController::get_cart_coupons()
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() 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() ); }