class uc_coupon_handler_field_product_type in Ubercart Discount Coupons 6
Same name and namespace in other branches
- 7.3 views/uc_coupon_handler_field_product_type.inc \uc_coupon_handler_field_product_type
- 7.2 views/uc_coupon_handler_field_product_type.inc \uc_coupon_handler_field_product_type
List the product types applicable to this coupon
Hierarchy
- class \uc_coupon_handler_field_product_type extends \views_handler_field_prerender_list
Expanded class hierarchy of uc_coupon_handler_field_product_type
1 string reference to 'uc_coupon_handler_field_product_type'
- uc_coupon_views_data in views/
uc_coupon.views.inc - Implementation of hook_views_data().
File
- views/
uc_coupon_handler_field_product_type.inc, line 10 - Views handler for coupon applicable product type
View source
class uc_coupon_handler_field_product_type extends views_handler_field_prerender_list {
function pre_render($values) {
$this->items = array();
foreach ($values as $value) {
$cid = $value->{$this->field_alias};
$data = unserialize($value->{$this->aliases['data']});
if (isset($data['product_types'])) {
$this->items[$cid] = $data['product_types'];
}
else {
$this->items[$cid] = array(
t('Any'),
);
}
}
}
}