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.
Method of the class: WC_Order_Item{}
No Hooks.
Returns
null
. Nothing (null).
Usage
$WC_Order_Item = new WC_Order_Item(); $WC_Order_Item->set_cogs_value( $value ): void;
- $value(float) (required)
- The value to set for this order item.
WC_Order_Item::set_cogs_value() WC Order Item::set cogs value code WC 9.8.5
public function set_cogs_value( float $value ): void { if ( $this->has_cogs() && $this->cogs_is_enabled( __METHOD__ ) ) { $this->set_prop( 'cogs_value', $value ); } }