public function Price::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
File
- uc_store/
src/ Plugin/ views/ field/ Price.php, line 54
Class
- Price
- Field handler to provide formatted prices.
Namespace
Drupal\uc_store\Plugin\views\fieldCode
public function render(ResultRow $values) {
if ($this->options['format'] == 'uc_price') {
$value = $this
->getValue($values);
if (is_null($value) || $value == 0 && $this->options['empty_zero']) {
return '';
}
return uc_currency_format($value);
}
else {
return parent::render($values);
}
}