Warning: This method has been deprecated.
WC_Abstract_Legacy_Product::reduce_stock( int $amount = 1 )
Reduce stock level of the product.
Description Description
Parameters Parameters
- $amount
-
(Optional) Amount to reduce by. Default: 1
Default value: 1
Return Return
(int) new stock level
Source Source
File: includes/legacy/abstract-wc-legacy-product.php
public function reduce_stock( $amount = 1 ) {
wc_deprecated_function( 'WC_Product::reduce_stock', '3.0', 'wc_update_product_stock' );
return wc_update_product_stock( $this, $amount, 'decrease' );
}
Changelog Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |