WC_Order_Item::has_cogs()
Indicates if the current order item has an associated Cost of Goods Sold value.
Derived classes representing line items that have a COGS value should override this method to return "true" and also the 'calculate_cogs_value_core' method.
Method of the class: WC_Order_Item{}
No Hooks.
Returns
true|false
. True if this line item has an associated Cost of Goods Sold value.
Usage
$WC_Order_Item = new WC_Order_Item(); $WC_Order_Item->has_cogs(): bool;
Changelog
Since 9.5.0 | Introduced. |
WC_Order_Item::has_cogs() WC Order Item::has cogs code WC 9.8.5
public function has_cogs(): bool { return false; }