WC_Product::get_cogs_value_html()
Returns the Cost of Goods Sold value in html format.
Метод класса: WC_Product{}
Хуки из метода
Возвращает
Строку
.
Использование
$WC_Product = new WC_Product(); $WC_Product->get_cogs_value_html();
Код WC_Product::get_cogs_value_html() WC Product::get cogs value html WC 9.8.1
public function get_cogs_value_html() { $value = $this->get_cogs_total_value(); if ( 0.0 === $value ) { /** * Filter to customize how an empty Cost of Goods Sold value for a product gets rendered to HTML. * * @param string $html The rendered HTML. * @param WC_Product $product The product for which the cost is rendered. * * @since 9.8.0 */ $html = apply_filters( 'woocommerce_empty_cogs_html', '', $this ); } else { $html = wc_price( $value ) . $this->get_price_suffix(); } /** * Filter to customize how the Cost of Goods Sold value for a product gets rendered to HTML. * * @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. * * @since 9.8.0 */ return apply_filters( 'woocommerce_get_cogs_html', $html, $value, $this ); }