WC_Product::set_virtual()publicWC 3.0.0

Set if the product is virtual.

Method of the class: WC_Product{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Product = new WC_Product();
$WC_Product->set_virtual( $virtual );
$virtual(true|false|string) (required)
Whether product is virtual or not.

Changelog

Since 3.0.0 Introduced.

WC_Product::set_virtual() code WC 8.7.0

public function set_virtual( $virtual ) {
	$this->set_prop( 'virtual', wc_string_to_bool( $virtual ) );
}