WC_Coupon::set_code()publicWC 3.0.0

Set coupon code.

Method of the class: WC_Coupon{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Coupon = new WC_Coupon();
$WC_Coupon->set_code( $code );
$code(string) (required)
Coupon code.

Changelog

Since 3.0.0 Introduced.

WC_Coupon::set_code() code WC 9.4.2

public function set_code( $code ) {
	$this->set_prop( 'code', wc_format_coupon_code( $code ) );
}