function commerce_registration_field_extra_fields in Commerce Registration 7.2
Same name and namespace in other branches
- 7.3 commerce_registration.module \commerce_registration_field_extra_fields()
Implements hook_field_extra_fields().
File
- ./
commerce_registration.module, line 613 - Commerce Registration module code.
Code
function commerce_registration_field_extra_fields() {
$items = array();
// Add registration availability display option to each commerce product type.
foreach (field_info_instances('commerce_product') as $product_bundle_name => $product_fields) {
foreach ($product_fields as $product_field_name => $product_field) {
if ($product_field['widget']['module'] == 'registration') {
$items['commerce_product'][$product_bundle_name]['display']['registration_available'] = array(
'label' => t('Registration Availability'),
'description' => t('The Registration availability text next to the product.'),
'weight' => -1,
);
}
}
}
// Add registration section to commerce_order form.
$items['commerce_order']['commerce_order']['form']['commerce_registration'] = array(
'label' => t('Registrations'),
'weight' => t('Section for managing the product registrations attached to the order.'),
);
return $items;
}