WC_Product_External::set_manage_stock()publicWC 3.0.0

External products cannot be stock managed.

Method of the class: WC_Product_External{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Product_External = new WC_Product_External();
$WC_Product_External->set_manage_stock( $manage_stock );
$manage_stock(true|false) (required)
If manage stock.

Changelog

Since 3.0.0 Introduced.

WC_Product_External::set_manage_stock() code WC 8.9.0

public function set_manage_stock( $manage_stock ) {
	$this->set_prop( 'manage_stock', false );

	if ( true === $manage_stock ) {
		$this->error( 'product_external_invalid_manage_stock', __( 'External products cannot be stock managed.', 'woocommerce' ) );
	}
}