woocommerce_format_stock_quantity filter-hook . WC 3.0.0
Format the stock quantity ready for display.
Usage
add_filter( 'woocommerce_format_stock_quantity', 'filter_function_name_3819', 10, 2 ); function filter_function_name_3819( $stock_quantity, $product ){ // filter... return $stock_quantity; }
- $stock_quantity(int)
- Stock quantity.
- $product(WC_Product)
- Product instance so that we can pass through the filters.
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
woocommerce_format_stock_quantity
woocommerce/includes/wc-formatting-functions.php 1256
return apply_filters( 'woocommerce_format_stock_quantity', $stock_quantity, $product );