woocommerce_get_cogs_html хук-фильтрWC 9.8.0

Filter to customize how the Cost of Goods Sold value for a product gets rendered to HTML.

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

add_filter( 'woocommerce_get_cogs_html', 'wp_kama_woocommerce_get_cogs_html_filter', 10, 3 );

/**
 * Function for `woocommerce_get_cogs_html` filter-hook.
 * 
 * @param string     $html    The rendered HTML.
 * @param float      $value   The cost value that is being rendered.
 * @param WC_Product $product The product for which the cost is rendered.
 *
 * @return string
 */
function wp_kama_woocommerce_get_cogs_html_filter( $html, $value, $product ){

	// filter...
	return $html;
}
$html(строка)
The rendered HTML.
$value(float)
The cost value that is being rendered.
$product(WC_Product)
The product for which the cost is rendered.

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

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

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

WC_Product::get_cogs_value_html()
woocommerce_get_cogs_html
woocommerce/includes/abstracts/abstract-wc-product.php 1981
return apply_filters( 'woocommerce_get_cogs_html', $html, $value, $this );

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

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