woocommerce_order_cogs_total_value_html хук-фильтрWC 10.3.0

Filter to customize the total Cost of Goods Sold (COGS) value HTML for a given order.

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

add_filter( 'woocommerce_order_cogs_total_value_html', 'wp_kama_woocommerce_order_cogs_total_value_html_filter', 10, 3 );

/**
 * Function for `woocommerce_order_cogs_total_value_html` filter-hook.
 * 
 * @param string   $total_html The formatted total COGS HTML.
 * @param float    $total      The total COGS value.
 * @param WC_Order $order      The order object.
 *
 * @return string
 */
function wp_kama_woocommerce_order_cogs_total_value_html_filter( $total_html, $total, $order ){

	// filter...
	return $total_html;
}
$total_html(строка)
The formatted total COGS HTML.
$total(float)
The total COGS value.
$order(WC_Order)
The order object.

Список изменений

С версии 10.3.0 Введена.

Где вызывается хук

WC_Abstract_Order::get_cogs_total_value_html()
woocommerce_order_cogs_total_value_html
woocommerce/includes/abstracts/abstract-wc-order.php 2638-2643
return apply_filters(
	'woocommerce_order_cogs_total_value_html',
	wc_price( $cogs_total_value, $wc_price_arg ?? array( 'currency' => $this->get_currency() ) ),
	$cogs_total_value,
	$this
);

Где используется хук в WooCommerce

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