WC_Coupon::get_datapublicWC 2.6.0

Returns all data for this object.

Method of the class: WC_Coupon{}

No Hooks.

Returns

Array.

Usage

$WC_Coupon = new WC_Coupon();
$WC_Coupon->get_data();

Changelog

Since 2.6.0 Introduced.

WC_Coupon::get_data() code WC 10.8.1

public function get_data() {
	// Ensure used_by is populated before the raw data array is returned, since
	// parent::get_data() reads $this->data directly and bypasses get_used_by().
	$this->get_used_by( 'edit' );
	$data = parent::get_data();
	if ( '' === $data['minimum_amount'] ) {
		$data['minimum_amount'] = '0';
	}
	if ( '' === $data['maximum_amount'] ) {
		$data['maximum_amount'] = '0';
	}
	return $data;
}