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'
Return Return
(int)
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 );
}
Changelog Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |