uc_order_handler_field_weight_total.inc 678 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * @file
  4. * Total weight field handler.
  5. */
  6. /**
  7. * Field handler: displays a weight multiplied by the quantity.
  8. */
  9. class uc_order_handler_field_weight_total extends uc_product_handler_field_weight {
  10. /**
  11. * Overrides views_handler_field::query().
  12. */
  13. function query() {
  14. $this->ensure_my_table();
  15. $table = $this->table_alias;
  16. $field = $this->real_field;
  17. $params = $this->options['group_type'] != 'group' ? array('function' => $this->options['group_type']) : array();
  18. $this->field_alias = $this->query->add_field(NULL, "$table.$field * $table.qty", $this->table . '_' . $this->field, $params);
  19. $this->add_additional_fields();
  20. }
  21. }