WC_Product::get_cogs_total_value()publicWC 1.0

Get the effective total value of the Cost of Goods Sold for this product. This is the monetary value that will be applied to orders and used for analytics purposes, see also get_cogs_total_value_core.

WARNING! If the Cost of Goods Sold feature is disabled this method will always return zero.

Метод класса: WC_Product{}

Хуки из метода

Возвращает

float. The effective total value for this product.

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

$WC_Product = new WC_Product();
$WC_Product->get_cogs_total_value(): float;

Код WC_Product::get_cogs_total_value() WC 9.7.1

public function get_cogs_total_value(): float {
	if ( ! $this->cogs_is_enabled( __METHOD__ ) ) {
		return 0;
	}

	/**
	 * Filter to customize the total Cost of Goods Sold value that get_cogs_total_value returns for a given product.
	 *
	 * @since 9.5.0
	 *
	 * @param float $total_value The effective total value of the product.
	 * @param WC_Product $product The product for which the total value is being retrieved.
	 */
	return apply_filters( 'woocommerce_get_product_cogs_total_value', $this->get_cogs_total_value_core(), $this );
}