function bat_options_price_options in Booking and Availability Management Tools for Drupal 7
Same name and namespace in other branches
- 8 modules/bat_options/bat_options.module \bat_options_price_options()
Returns the available price options for booking_unit options field.
Parameters
$per_person:
Return value
array
2 calls to bat_options_price_options()
- bat_options_field_is_empty in modules/
bat_options/ bat_options.module - Implements hook_field_is_empty().
- bat_options_field_widget_form in modules/
bat_options/ bat_options.module - Implements hook_field_widget_form().
File
- modules/
bat_options/ bat_options.module, line 460
Code
function bat_options_price_options($per_person = FALSE) {
$options = array(
BAT_OPTIONS_ADD => t('Add to price'),
BAT_OPTIONS_ADD_DAILY => t('Add to price per night'),
BAT_OPTIONS_SUB => t('Subtract from price'),
BAT_OPTIONS_SUB_DAILY => t('Subtract from price per night'),
BAT_OPTIONS_REPLACE => t('Replace price'),
BAT_OPTIONS_INCREASE => t('Increase price by % amount'),
BAT_OPTIONS_DECREASE => t('Decrease price by % amount'),
BAT_OPTIONS_NOCHARGE => t('No charge'),
);
if ($per_person) {
$options[BAT_OPTIONS_ADD_PERSON] = t('Add to price per person');
$options[BAT_OPTIONS_ADD_DAILY_PERSON] = t('Add to price per night per person');
$options[BAT_OPTIONS_SUB_PERSON] = t('Subtract from price per person');
$options[BAT_OPTIONS_SUB_DAILY_PERSON] = t('Subtract from price per night per person');
}
drupal_alter('bat_options_price_options', $options);
return $options;
}