fixed WC_Product_Variable::set_stock() compatibility with WC_Product::set_stock()
This commit is contained in:
parent
a059290fa8
commit
b1207d8eda
|
@ -79,14 +79,15 @@ class WC_Product_Variable extends WC_Product {
|
||||||
* Set stock level of the product.
|
* Set stock level of the product.
|
||||||
*
|
*
|
||||||
* @param mixed $amount (default: null)
|
* @param mixed $amount (default: null)
|
||||||
|
* @param string $mode can be set, add, or subtract
|
||||||
* @return int Stock
|
* @return int Stock
|
||||||
*/
|
*/
|
||||||
function set_stock( $amount = null ) {
|
function set_stock( $amount = null, $mode = 'set' ) {
|
||||||
// Empty total stock so its refreshed
|
// Empty total stock so its refreshed
|
||||||
$this->total_stock = '';
|
$this->total_stock = '';
|
||||||
|
|
||||||
// Call parent set_stock
|
// Call parent set_stock
|
||||||
return parent::set_stock( $amount );
|
return parent::set_stock( $amount, $mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue