|
|
@ -523,21 +523,24 @@ function fulcrm_shoppingcart_buy_eventbookingtype_form_submit( $form, &$form_sta
|
|
|
|
if ( array_key_exists( 'ticket_for_persons', $form_state[ 'values' ] ) ) {
|
|
|
|
if ( array_key_exists( 'ticket_for_persons', $form_state[ 'values' ] ) ) {
|
|
|
|
$ticket_for_persons = $form_state[ 'values' ][ 'ticket_for_persons' ];
|
|
|
|
$ticket_for_persons = $form_state[ 'values' ][ 'ticket_for_persons' ];
|
|
|
|
if ( !is_array( $ticket_for_persons ) )
|
|
|
|
if ( !is_array( $ticket_for_persons ) )
|
|
|
|
$ticket_for_persons = array( $ticket_for_persons );
|
|
|
|
$ticket_for_persons = array( $ticket_for_persons => 1 );
|
|
|
|
foreach ( $ticket_for_persons as $ticket_for_person ) {
|
|
|
|
foreach ( $ticket_for_persons as $ticket_for_person => $add ) {
|
|
|
|
$add_person_name = 'unnamed person';
|
|
|
|
if ( $add ) {
|
|
|
|
if ( $ticket_for_person === 'myself' ) {
|
|
|
|
$add_person_name = 'unnamed person';
|
|
|
|
$add_person_uuid = $form_state[ 'fulcrm_shoppingcart' ][ 'person' ][ 'uuid' ];
|
|
|
|
if ( $ticket_for_person === 'myself' ) {
|
|
|
|
$add_person_name = $form_state[ 'fulcrm_shoppingcart' ][ 'person' ][ 'name' ];
|
|
|
|
$add_person_uuid = $form_state[ 'fulcrm_shoppingcart' ][ 'person' ][ 'uuid' ];
|
|
|
|
} else {
|
|
|
|
$add_person_name = $form_state[ 'fulcrm_shoppingcart' ][ 'person' ][ 'name' ];
|
|
|
|
$add_person_uuid = fulcrm_crypto_get_object_id_form_value( 'person.uuid', $ticket_for_person );
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$add_person_uuid = fulcrm_crypto_get_object_id_form_value( 'person.uuid', $ticket_for_person );
|
|
|
|
|
|
|
|
if ( $add_person_uuid )
|
|
|
|
|
|
|
|
$add_person_name = $form_state[ 'fulcrm_shoppingcart' ][ 'persons' ][ $add_person_uuid ][ 'name' ];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( $add_person_uuid )
|
|
|
|
if ( $add_person_uuid )
|
|
|
|
$add_person_name = $form_state[ 'fulcrm_shoppingcart' ][ 'persons' ][ $add_person_uuid ][ 'name' ];
|
|
|
|
_fulcrm_shoppingcart_buy_eventbookingtype_create_shoppingitem( $form_state, $cart,
|
|
|
|
|
|
|
|
$add_person_uuid, $add_person_name, $product_id,
|
|
|
|
|
|
|
|
$made_choices = $made_choices );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_fulcrm_shoppingcart_buy_eventbookingtype_create_shoppingitem( $form_state, $cart,
|
|
|
|
|
|
|
|
$add_person_uuid, $add_person_name, $product_id,
|
|
|
|
|
|
|
|
$made_choices = $made_choices );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if ( $person_uuid ) {
|
|
|
|
if ( $person_uuid ) {
|
|
|
|