WC_Abstract_Order::get_cogs_total_value_html
Return the HTML to render the total Cost of Goods Sold for the order.
Метод класса: WC_Abstract_Order{}
Хуки из метода
Возвращает
Строку.
Использование
$WC_Abstract_Order = new WC_Abstract_Order(); $WC_Abstract_Order->get_cogs_total_value_html( ?array $wc_price_arg ): string;
- ?array $wc_price_arg
- .
По умолчанию: null
Код WC_Abstract_Order::get_cogs_total_value_html() WC Abstract Order::get cogs total value html WC 10.3.4
public function get_cogs_total_value_html( ?array $wc_price_arg = null ): string {
if ( ! $this->cogs_is_enabled( __METHOD__ ) || ! $this->has_cogs() ) {
return '';
}
$cogs_total_value = $this->get_cogs_total_value();
/**
* Filter to customize the total Cost of Goods Sold (COGS) value HTML for a given order.
*
* @since 10.3.0
*
* @param string $total_html The formatted total COGS HTML.
* @param float $total The total COGS value.
* @param WC_Order $order The order object.
*/
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
);
}