You are here

function discounted_price_handler::render in Ubercart Discounts (Alternative) 7.2

Same name and namespace in other branches
  1. 6.2 product_price_alterer_field/includes/discounted_price_handler.inc \discounted_price_handler::render()

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

product_price_alterer_field/includes/discounted_price_handler.inc, line 20
Views handler integration for product_price_alterer_field module.

Class

discounted_price_handler
Renders a discounted price field.

Code

function render($values) {
  $node = node_load($values->{$this->aliases['nid']});
  $discounted_price = uc_discounts_get_discounted_price_for_product($node);
  if (is_null($discounted_price)) {
    return NULL;
  }
  $output = theme('product_discounted_price', $node, uc_currency_format($discounted_price));
  add_product_price_altering_css($node);
  add_product_price_altering_javascript($node);
  return check_plain($output);
}