woocommerce_order_item_no_cogs_html filter-hookWC 9.9.0

Filter to customize how a non-existing Cost of Goods Sold value for an order item (whose has_cogs method returns false) gets rendered to HTML.

Usage

add_filter( 'woocommerce_order_item_no_cogs_html', 'wp_kama_woocommerce_order_item_no_cogs_html_filter', 10, 2 );

/**
 * Function for `woocommerce_order_item_no_cogs_html` filter-hook.
 * 
 * @param string        $html    The rendered HTML.
 * @param WC_Order_Item $product The order item for which the "there's no cost" indication is rendered.
 *
 * @return string
 */
function wp_kama_woocommerce_order_item_no_cogs_html_filter( $html, $product ){

	// filter...
	return $html;
}
$html(string)
The rendered HTML.
$product(WC_Order_Item)
The order item for which the "there's no cost" indication is rendered.

Changelog

Since 9.9.0 Introduced.

Where the hook is called

WC_Order_Item::get_cogs_value_html()
woocommerce_order_item_no_cogs_html
woocommerce/includes/class-wc-order-item.php 574
return apply_filters( 'woocommerce_order_item_no_cogs_html', "<span class='na'>&ndash;</span>", $this );

Where the hook is used in WooCommerce

Usage not found.