diff --git a/booking.regn_form.inc b/booking.regn_form.inc index 5074eb2..4144feb 100644 --- a/booking.regn_form.inc +++ b/booking.regn_form.inc @@ -97,10 +97,13 @@ function booking_form($node, &$form_state, $inserting = FALSE, $early_access_all $price_query->condition($db_and); $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, );