wc_recount_after_stock_change()WC 1.0

Recount terms after the stock amount changes.

Хуков нет.

Возвращает

null. Ничего.

Использование

wc_recount_after_stock_change( $product_id );
$product_id(int) (обязательный)
Product ID.

Код wc_recount_after_stock_change() WC 6.4.1

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 );
}