add checks for earlyaccess
This commit is contained in:
@@ -98,9 +98,12 @@ function booking_form($node, &$form_state, $inserting = FALSE, $early_access_all
|
||||
$price_query->fields('p');
|
||||
$result = $price_query->execute();
|
||||
|
||||
// allow discounted payments if we're in early rates or early access is allowed
|
||||
$early_payment_flag = $select_early || $early_access_allowed;
|
||||
|
||||
foreach ($result as $row) {
|
||||
$price = $select_early == TRUE ? $row->booking_price : $row->booking_late_price;
|
||||
$discount_suffix = $select_early == TRUE ? " - discounted rate" : "";
|
||||
$price = $early_payment_flag == TRUE ? $row->booking_price : $row->booking_late_price;
|
||||
$discount_suffix = $early_payment_flag == TRUE ? " - discounted rate" : "";
|
||||
$payment_type_options[$row->pid] = $row->booking_price_descrip . ' ($' . $price . ')' . $discount_suffix;
|
||||
}
|
||||
|
||||
@@ -201,7 +204,7 @@ function booking_form($node, &$form_state, $inserting = FALSE, $early_access_all
|
||||
$form['your-details']['booking_payment_id'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Choose your payment type'),
|
||||
'#description' => $select_early == TRUE ? $early_description_text : "",
|
||||
'#description' => $early_payment_flag == TRUE ? $early_description_text : "",
|
||||
'#default_value' => $inserting != TRUE ? $data->booking_payment_id : variable_get('booking_payment_id', 'worker'),
|
||||
'#options' => $payment_type_options,
|
||||
);
|
||||
|
Reference in New Issue
Block a user