class discounted_price_handler in Ubercart Discounts (Alternative) 6.2
Same name and namespace in other branches
- 7.2 product_price_alterer_field/includes/discounted_price_handler.inc \discounted_price_handler
Renders a discounted price field.
Hierarchy
- class \discounted_price_handler extends \views_handler_field
Expanded class hierarchy of discounted_price_handler
1 string reference to 'discounted_price_handler'
- product_price_alterer_field_views_data in product_price_alterer_field/
product_price_alterer_field.views.inc - Implementation of hook_views_data() Register all of the basic handlers views uses.
File
- product_price_alterer_field/
includes/ discounted_price_handler.inc, line 9
View source
class discounted_price_handler extends views_handler_field {
function query() {
$this
->ensure_my_table();
$this
->add_additional_fields();
}
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);
}
}