WordPress at Your Fingertips
function is not described

WC_Abstract_Order::get_coupon_codes() public WC 3.7.0

Get used coupon codes only.

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

No Hooks.

Return

Array.

Usage

$WC_Abstract_Order = new WC_Abstract_Order();
$WC_Abstract_Order->get_coupon_codes();

Changelog

Since 3.7.0 Introduced.

Code of WC_Abstract_Order::get_coupon_codes() WC 5.8.0

public function get_coupon_codes() {
	$coupon_codes = array();
	$coupons      = $this->get_items( 'coupon' );

	if ( $coupons ) {
		foreach ( $coupons as $coupon ) {
			$coupon_codes[] = $coupon->get_code();
		}
	}
	return $coupon_codes;
}