WordPress at Your Fingertips
function is not described

WC_Coupon::set_code() public WC 3.0.0

Set coupon code.

{} It's a method of the class: WC_Coupon{}

No Hooks.

Return

null. Nothing.

Usage

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

Changelog

Since 3.0.0 Introduced.

Code of WC_Coupon::set_code() WC 5.6.0

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