WC_Coupon::set_short_info()publicWC 1.0

Sets the coupon parameters from a reapply information set generated with 'get_short_info'.

Method of the class: WC_Coupon{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Coupon = new WC_Coupon();
$WC_Coupon->set_short_info( $info );
$info(string) (required)
JSON string with reapply information as returned by 'get_short_info'.

WC_Coupon::set_short_info() code WC 9.4.2

public function set_short_info( string $info ) {
	$info = json_decode( $info, true );

	$this->set_id( $info[0] ?? 0 );
	$this->set_code( $info[1] ?? '' );
	$this->set_discount_type( $info[2] ?? 'fixed_cart' );
	$this->set_amount( $info[3] ?? 0 );
	$this->set_free_shipping( $info[4] ?? false );
}