wc_recount_after_stock_change()
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() wc recount after stock change code WC 9.6.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 ); }