public function Weight::render in Ubercart 8.4
Renders the field.
Parameters
\Drupal\views\ResultRow $values: The values retrieved from a single row of a view's query result.
Return value
string|\Drupal\Component\Render\MarkupInterface The rendered output. If the output is safe it will be wrapped in an object that implements MarkupInterface. If it is empty or unsafe it will be a string.
Overrides NumericField::render
1 call to Weight::render()
- OrderWeightTotal::render in uc_order/
src/ Plugin/ views/ field/ OrderWeightTotal.php - Renders the field.
2 methods override Weight::render()
- OrderWeightTotal::render in uc_order/
src/ Plugin/ views/ field/ OrderWeightTotal.php - Renders the field.
- PackageWeight::render in shipping/
uc_fulfillment/ src/ Plugin/ views/ field/ PackageWeight.php - Renders the field.
File
- uc_store/
src/ Plugin/ views/ field/ Weight.php, line 54
Class
- Weight
- Field handler to provide formatted weights.
Namespace
Drupal\uc_store\Plugin\views\fieldCode
public function render(ResultRow $values) {
if ($this->options['format'] == 'uc_weight') {
$value = $this
->getValue($values);
if (is_null($value) || $value == 0 && $this->options['empty_zero']) {
return '';
}
return uc_weight_format($value, $values->{$this->aliases['weight_units']});
}
else {
return parent::render($values);
}
}