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.

See also


Top ↑

Parameters

$item

(Required) The line item to review if has a discount


Top ↑

Return

(bool)


Top ↑

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']
		);
	}

Top ↑

Changelog

Changelog
Version Description
4.7.3 Introduced.