Warning: This method has been deprecated.

WC_Abstract_Legacy_Product::set_stock( int $amount = null, string $mode = 'set' )

Set stock level of the product.


Description Description


Parameters Parameters

$amount

(Optional)

Default value: null

$mode

(Optional)

Default value: 'set'


Top ↑

Return Return

(int)


Top ↑

Source Source

File: includes/legacy/abstract-wc-legacy-product.php

	public function set_stock( $amount = null, $mode = 'set' ) {
		wc_deprecated_function( 'WC_Product::set_stock', '3.0', 'wc_update_product_stock' );
		return wc_update_product_stock( $this, $amount, $mode );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.