WordPress at Your Fingertips
function is not described

WC_Product_External::set_backorders() public WC 3.0.0

External products cannot be backordered.

{} 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_backorders( $backorders );
$backorders(string) (required)
Options: 'yes', 'no' or 'notify'.

Changelog

Since 3.0.0 Introduced.

Code of WC_Product_External::set_backorders() WC 5.6.0

public function set_backorders( $backorders ) {
	$this->set_prop( 'backorders', 'no' );

	if ( 'no' !== $backorders ) {
		$this->error( 'product_external_invalid_backorders', __( 'External products cannot be backordered.', 'woocommerce' ) );
	}
}