WC_Product_Variation::get_cogs_total_value_core()
Get the effective total value of the Cost of Goods Sold for this product. (the monetary value that will be applied to orders and used for analytics purposes).
If "additive" flag is set, the total value is equal to sum of the effective values of the variation and the parent product. Otherwise, if the defined value for this variation is null, the effective value is equal to the effective value of the parent product. Otherwise, the effective value is equal to the effective value of the variation.
Метод класса: WC_Product_Variation{}
Хуков нет.
Возвращает
float
.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_cogs_total_value_core(): float;
Код WC_Product_Variation::get_cogs_total_value_core() WC Product Variation::get cogs total value core WC 9.8.2
protected function get_cogs_total_value_core(): float { if ( $this->get_cogs_value_is_additive() ) { return $this->get_parent_cogs_effective_value() + $this->get_cogs_effective_value(); } else { return is_null( $this->get_cogs_value() ) ? $this->get_parent_cogs_effective_value() : $this->get_cogs_effective_value(); } }