WC_Order_Item::set_cogs_value()
Set the value of the Cost of Goods Sold for this order item. Usually you'll want to use calculate_cogs_value instead.
WARNING! If the Cost of Goods Sold feature is disabled this method will have no effect.
Метод класса: WC_Order_Item{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WC_Order_Item = new WC_Order_Item(); $WC_Order_Item->set_cogs_value( $value ): void;
- $value(float) (обязательный)
- The value to set for this order item.
Код WC_Order_Item::set_cogs_value() WC Order Item::set cogs value WC 9.6.1
public function set_cogs_value( float $value ): void { if ( $this->has_cogs() && $this->cogs_is_enabled( __METHOD__ ) ) { $this->set_prop( 'cogs_value', $value ); } }