WC_Coupon::set_short_info
Sets the coupon parameters from a reapply information set generated with 'get_short_info'.
Method of the class: WC_Coupon{}
No Hooks.
Returns
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() WC Coupon::set short info code WC 10.4.3
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_core( $info[2] ?? 'fixed_cart', false );
$this->set_amount( $info[3] ?? 0 );
$this->set_free_shipping( $info[4] ?? false );
}