Tribe__Tickets_Plus__Commerce__WooCommerce__Orders__Table::item_has_discount( $item )
Logic to detect if an item has a discount based on a discrepancy between total and subtotal.
Contents
See also
Parameters
- $item
-
(Required) The line item to review if has a discount
Return
(bool)
Source
File: src/Tribe/Commerce/WooCommerce/Orders/Table.php
public static function item_has_discount( $item ) {
return (
isset( $item['subtotal'] )
&& isset( $item['total'] )
&& $item['subtotal'] !== $item['total']
);
}
Changelog
| Version | Description |
|---|---|
| 4.7.3 | Introduced. |