woocommerce_order_item_cogs_html
Filter to customize how the Cost of Goods Sold value for an order item gets rendered to HTML.
Usage
add_filter( 'woocommerce_order_item_cogs_html', 'wp_kama_woocommerce_order_item_cogs_html_filter', 10, 3 ); /** * Function for `woocommerce_order_item_cogs_html` filter-hook. * * @param string $html The rendered HTML. * @param float $value The cost value that is being rendered. * @param WC_Order_Item $product The order item. * * @return string */ function wp_kama_woocommerce_order_item_cogs_html_filter( $html, $value, $product ){ // filter... return $html; }
- $html(string)
- The rendered HTML.
- $value(float)
- The cost value that is being rendered.
- $product(WC_Order_Item)
- The order item.
Changelog
Since 9.9.0 | Introduced. |
Where the hook is called
woocommerce_order_item_cogs_html
woocommerce/includes/class-wc-order-item.php 589
return apply_filters( 'woocommerce_order_item_cogs_html', $cogs_value_html, $cogs_value, $this );