Merge branch 'pr/18013'
This commit is contained in:
commit
05d6e393ae
|
@ -43,6 +43,7 @@ function wc_update_product_stock( $product, $stock_quantity = null, $operation =
|
|||
// Re-read product data after updating stock, then have stock status calculated and saved.
|
||||
$product_with_stock = wc_get_product( $product_id_with_stock );
|
||||
$product_with_stock->set_stock_status();
|
||||
$product_with_stock->set_date_modified( current_time( 'timestamp', true ) );
|
||||
$product_with_stock->save();
|
||||
|
||||
do_action( $product_with_stock->is_type( 'variation' ) ? 'woocommerce_variation_set_stock' : 'woocommerce_product_set_stock', $product_with_stock );
|
||||
|
|
Loading…
Reference in New Issue