You are here

function uc_shipping_handler_field_package_weight::render in Ubercart 7.3

Overrides uc_product_handler_field_weight::render().

Overrides uc_product_handler_field_weight::render

File

shipping/uc_shipping/views/uc_shipping_handler_field_package_weight.inc, line 36
Total package weight field handler.

Class

uc_shipping_handler_field_package_weight
Field handler: displays the weight of the package.

Code

function render($values) {
  $package = uc_shipping_package_load($values->{$this->aliases['package_id']});
  if ($this->options['format'] == 'numeric') {
    return $package->weight;
  }
  if ($this->options['format'] == 'uc_weight') {
    return uc_weight_format($package->weight, $package->weight_units);
  }
}