WC_Coupon::set_short_infopublicWC 1.0

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

Метод класса: WC_Coupon{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WC_Coupon = new WC_Coupon();
$WC_Coupon->set_short_info( $info );
$info(строка) (обязательный)
JSON string with reapply information as returned by 'get_short_info'.

Код WC_Coupon::set_short_info() WC 10.6.2

public function set_short_info( string $info ) {
	$data = self::parse_short_info( $info );

	$this->set_id( $data['id'] );
	$this->set_code( $data['code'] );
	$this->set_discount_type_core( $data['discount_type'], false );
	$this->set_amount( $data['amount'] );
	$this->set_free_shipping( $data['free_shipping'] );
}