wc_recount_after_stock_change()WC 1.0

Recount terms after the stock amount changes.

No Hooks.

Return

null. Nothing (null).

Usage

wc_recount_after_stock_change( $product_id );
$product_id(int) (required)
Product ID.

wc_recount_after_stock_change() code WC 8.7.0

function wc_recount_after_stock_change( $product_id ) {
	if ( 'yes' !== get_option( 'woocommerce_hide_out_of_stock_items' ) ) {
		return;
	}

	_wc_recount_terms_by_product( $product_id );
}