public static function formatFieldsForOptionFull(&$form) {
$priceSet = $form->get('priceSet');
$priceSetId = $form->get('priceSetId');
+ $defaultPricefieldIds = array();
+ if (!empty($form->_values['line_items'])) {
+ foreach ($form->_values['line_items'] as $lineItem) {
+ $defaultPricefieldIds[] = $lineItem['price_field_value_id'];
+ }
+ }
if (!$priceSetId ||
!is_array($priceSet) ||
empty($priceSet) || empty($priceSet['optionsMaxValueTotal'])) {
//get the current price event price set options count.
$currentOptionsCount = self::getPriceSetOptionCount($form);
$recordedOptionsCount = CRM_Event_BAO_Participant::priceSetOptionsCount($form->_eventId, $skipParticipants);
+ $optionFullTotalAmount = 0;
foreach ($form->_feeBlock as & $field) {
$optionFullIds = array();
) {
$isFull = TRUE;
$optionFullIds[$optId] = $optId;
+ if ($field['html_type'] != 'Select') {
+ if (in_array($optId, $defaultPricefieldIds)) {
+ $optionFullTotalAmount += CRM_Utils_Array::value('amount', $option);
+ }
+ }
+ else {
+ if (!empty($defaultPricefieldIds) && in_array($optId, $defaultPricefieldIds)) {
+ unset($optionFullIds[$optId]);
+ }
+ }
}
-
//here option is not full,
//but we don't want to allow participant to increase
//seats at the time of re-walking registration.
//finally get option ids in.
$field['option_full_ids'] = $optionFullIds;
}
+ $form->assign('optionFullTotalAmount', $optionFullTotalAmount);
}
/**
{literal}
<script type='text/javascript'>
function display(totalfee) {
+ totalfee += {/literal}{$optionFullTotalAmount}{literal};
// totalfee is monetary, round it to 2 decimal points so it can
// go as a float - CRM-13491
totalfee = Math.round(totalfee*100)/100;