Merge branch 'pr/18013'

This commit is contained in:
Mike Jolley 2017-12-07 15:29:59 +00:00
commit 05d6e393ae
1 changed files with 1 additions and 0 deletions

View File

@ -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. // 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 = wc_get_product( $product_id_with_stock );
$product_with_stock->set_stock_status(); $product_with_stock->set_stock_status();
$product_with_stock->set_date_modified( current_time( 'timestamp', true ) );
$product_with_stock->save(); $product_with_stock->save();
do_action( $product_with_stock->is_type( 'variation' ) ? 'woocommerce_variation_set_stock' : 'woocommerce_product_set_stock', $product_with_stock ); do_action( $product_with_stock->is_type( 'variation' ) ? 'woocommerce_variation_set_stock' : 'woocommerce_product_set_stock', $product_with_stock );