public function total(array $condition, array $data)
    {
        if (!isset($data['cart']['total']) || empty($data['cart']['currency'])) {
            return false;
        }

        $condition_value = explode('|', reset($condition['value']), 2);
        $condition_currency = $data['cart']['currency'];

        if (!empty($condition_value[1])) {
            $condition_currency = $condition_value[1];
        }

        $condition_value[0] = $this->price->amount($condition_value[0], $condition_currency);
        $value = $this->currency->convert($condition_value[0], $condition_currency, $data['cart']['currency']);

        return $this->compare($data['cart']['total'], $value, $condition['operator']);
    }
public function total(array $condition, array $data)
    {
        if (!isset($data['cart']['total']) || empty($data['cart']['currency'])) {
            return false;
        }

        $condition_value = explode('|', reset($condition['value']), 2);
        $condition_currency = $data['cart']['currency'];

        if (!empty($condition_value[1])) {
            $condition_currency = $condition_value[1];
        }

        $condition_value[0] = $this->price->amount($condition_value[0], $condition_currency);
        $value = $this->currency->convert($condition_value[0], $condition_currency, $data['cart']['currency']);

        return $this->compare($data['cart']['total'], $value, $condition['operator']);
    }
public function total ( array $ condition , array $ data ) { if ( ! isset ( $ data [ 'cart' ] [ 'total' ] ) || empty ( $ data [ 'cart' ] [ 'currency' ] ) ) { return false ; } $ condition_value = explode ( '|' , reset ( $ condition [ 'value' ] ) , 2 ) ; $ condition_currency = $ data [ 'cart' ] [ 'currency' ] ; if ( ! empty ( $ condition_value [ 1 ] ) ) { $ condition_currency = $ condition_value [ 1 ] ; } $ condition_value [ 0 ] = $ this -> price -> amount ( $ condition_value [ 0 ] , $ condition_currency ) ; $ value = $ this -> currency -> convert ( $ condition_value [ 0 ] , $ condition_currency , $ data [ 'cart' ] [ 'currency' ] ) ; return $ this -> compare ( $ data [ 'cart' ] [ 'total' ] , $ value , $ condition [ 'operator' ] ) ; }
Whether the cart total condition is met
@param array $condition
@param array $data
@return boolean
Whether the cart total condition is met