original_string: 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']);
      }
code: 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']);
      }
code_tokens: 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' ] ) ; }
docstring: Whether the cart total condition is met
  @param array $condition
  @param array $data
  @return boolean
docstring_tokens: Whether the cart total condition is met