You are here

function uc_coupon_handler_filter_gross::query in Ubercart Discount Coupons 7.2

Same name and namespace in other branches
  1. 7.3 views/uc_coupon_handler_filter_gross.inc \uc_coupon_handler_filter_gross::query()

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides views_handler_filter_numeric::query

File

views/uc_coupon_handler_filter_gross.inc, line 10
Filter based on coupon order gross (total+value)

Class

uc_coupon_handler_filter_gross
@file Filter based on coupon order gross (total+value)

Code

function query() {
  $this
    ->ensure_my_table();
  $uco = $this->query
    ->ensure_table('uc_orders');
  $uc = $this->table_alias;
  $field = "({$uco}.order_total + {$uc}.value)";
  $info = $this
    ->operators();
  if (!empty($info[$this->operator]['method'])) {
    $this
      ->{$info[$this->operator]['method']}($field);
  }
}