woocommerce_stock_amount rather than intval
Using woocommerce_stock_amount filter rather than intval cast
This commit is contained in:
parent
cc27bd8bdf
commit
32d850a76a
|
@ -163,7 +163,7 @@ class WC_Product {
|
||||||
if ( $this->managing_stock() ) {
|
if ( $this->managing_stock() ) {
|
||||||
|
|
||||||
// Update stock amount
|
// Update stock amount
|
||||||
$this->stock = intval( $amount );
|
$this->stock = apply_filters( 'woocommerce_stock_amount', $amount );
|
||||||
|
|
||||||
// Update meta
|
// Update meta
|
||||||
update_post_meta( $this->id, '_stock', $this->stock );
|
update_post_meta( $this->id, '_stock', $this->stock );
|
||||||
|
|
Loading…
Reference in New Issue