WordPress at Your Fingertips
function is not described

WC_Product_External::set_stock_status() public WC 3.0.0

External products cannot be stock managed.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Product_External = new WC_Product_External();
$WC_Product_External->set_stock_status( $stock_status );
$stock_status(string)
Stock status.
Default: ''

Changelog

Since 3.0.0 Introduced.

Code of WC_Product_External::set_stock_status() WC 5.6.0

public function set_stock_status( $stock_status = '' ) {
	$this->set_prop( 'stock_status', 'instock' );

	if ( 'instock' !== $stock_status ) {
		$this->error( 'product_external_invalid_stock_status', __( 'External products cannot be stock managed.', 'woocommerce' ) );
	}
}