You are here

public function UcAddressesUCXFHandler::outputValue in Extra Fields Checkout Pane 7

Same name and namespace in other branches
  1. 6.2 includes/uc_addresses.handlers.inc \UcAddressesUCXFHandler::outputValue()

Output a fields value.

@access public

Parameters

mixed $value:

Return value

string

Overrides UcAddressesFieldHandler::outputValue

File

includes/uc_addresses.handlers.inc, line 168
Integration code for Ubercart Addresses 7.x-1.x

Class

UcAddressesUCXFHandler
Field handler for all Extra Fields Pane fields.

Code

public function outputValue($value = '', $format = '') {
  if ($value === '') {
    $value = $this
      ->getAddress()
      ->getField($this
      ->getFieldName());
  }
  $output = $this->ucxf_field
    ->output_value($value);
  if ($output == t('n/a') && $this
    ->getContext() == 'token') {

    // If the context is "token", don't output "n/a". Just return an
    // empty string in this case.
    // This is because tokens can be used in address labels and we
    // don't want to end up with a "n/a" in there.
    return '';
  }
  return $output;
}