WC_Product::set_downloadable()publicWC 3.0.0

Set if the product is downloadable.

Method of the class: WC_Product{}

No Hooks.

Return

null. Nothing (null).

Usage

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

Changelog

Since 3.0.0 Introduced.

WC_Product::set_downloadable() code WC 8.7.0

public function set_downloadable( $downloadable ) {
	$this->set_prop( 'downloadable', wc_string_to_bool( $downloadable ) );
}