/var/www/html_uk/wp-content/plugins/automatewoo/includes/Rules/Order_Item_Total.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php

namespace AutomateWoo\Rules;

defined'ABSPATH' ) || exit;

/**
 * Class Order_Item_Total
 *
 * @since 4.9.0
 */
class Order_Item_Total extends Abstract_Number {

    
/**
     * Data item the rule uses.
     *
     * @var string
     */
    
public $data_item 'order_item';

    
/**
     * Support float values.
     *
     * @var bool
     */
    
public $support_floats true;

    
/**
     * Init the rule.
     */
    
public function init() {
        
$this->title __'Order Line Item - Total''automatewoo' );
    }

    
/**
     * Validate the rule.
     *
     * @param \WC_Order_Item_Product $item
     * @param string                 $compare
     * @param string                 $value
     *
     * @return bool
     */
    
public function validate$item$compare$value ) {
        return 
$this->validate_number$item->get_total(), $compare$value );
    }
}