WC_Product_External::set_stock_status()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_stock_status( $stock_status );
$stock_status(string)
Stock status.
Default: ''

Changelog

Since 3.0.0 Introduced.

WC_Product_External::set_stock_status() code WC 9.1.2

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' ) );
	}
}