improvements to logout and checkout process
This commit is contained in:
		@ -183,7 +183,7 @@ function fulcrm_shoppingcart_person_add_form_submit( $form, &$form_state ) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    $api_data = fulcrm_apiv2_POST( 'person/', $person_data, $query = array( 'expand' => 'd' ) );
 | 
					    $api_data = fulcrm_apiv2_POST( 'person/', $person_data, $query = array( 'expand' => 'd' ) );
 | 
				
			||||||
    if ( $api_data[ 'success' ] ) {
 | 
					    if ( $api_data[ 'success' ] ) {
 | 
				
			||||||
        module_invoke_all( 'fulcrm_shoppingcart_person_add', $api_data[ 'data' ] );
 | 
					        module_invoke_all( 'fulcrm_shoppingcart_person_add', $api_data[ 'data' ], array_key_exists( 'destination', $_GET ) ? $_GET[ 'destination' ] : variable_get( 'fulcrm_shoppingcart_proceed_url', url('<front>') ) );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -324,7 +324,10 @@ function fulcrm_shoppingcart_buy_eventbookingtype_form( $form, &$form_state, $pe
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // $form[ 'person' ] = fulcrm_collection_to_form( 'person', $eventbookingtype[ 'person_ddatacollection' ], $person[ 'd' ] );
 | 
					    // $form[ 'person' ] = fulcrm_collection_to_form( 'person', $eventbookingtype[ 'person_ddatacollection' ], $person[ 'd' ] );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $persons = array( 'myself' => $person[ 'name' ] . ' (myself)' );
 | 
					    if ( array_key_exists( 'name', $person ) )
 | 
				
			||||||
 | 
					        $persons = array( 'myself' => $person[ 'name' ] . ' (myself)' );
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        $persons = array( 'myself' => '(myself)' );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ( array_key_exists( 'related_from_person2persons', $person ) ) {
 | 
					    if ( array_key_exists( 'related_from_person2persons', $person ) ) {
 | 
				
			||||||
        foreach ( $person[ 'related_from_person2persons' ] as $p2p ) {
 | 
					        foreach ( $person[ 'related_from_person2persons' ] as $p2p ) {
 | 
				
			||||||
@ -340,7 +343,7 @@ function fulcrm_shoppingcart_buy_eventbookingtype_form( $form, &$form_state, $pe
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $form[ 'ticket_for_persons' ] = array( '#type' => 'checkboxes',
 | 
					    $form[ 'ticket_for_persons' ] = array( '#type' => 'checkboxes',
 | 
				
			||||||
                                           '#title' => 'Who is coming to the event? (<a href="' . url( 'fulcrm/cart/person/add/' . $eventbookingtype[ 'person_ddatacollection' ][ 'id' ] . '/' . fulcrm_crypto_object_id_hmac( 'collection', $eventbookingtype[ 'person_ddatacollection' ][ 'id' ] ), $query = array( 'destination' => fulcrm_shoppingcart_buy_url( $product[ 'id' ] ) ) ) . '">add a new person to this list</a>)',
 | 
					                                           '#title' => 'Who is coming to the event? (<a href="' . url( 'fulcrm/cart/person/add/' . $eventbookingtype[ 'person_ddatacollection' ][ 'id' ] . '/' . fulcrm_crypto_object_id_hmac( 'collection', $eventbookingtype[ 'person_ddatacollection' ][ 'id' ] ), $options = array( 'query' => array( 'destination' => fulcrm_shoppingcart_buy_url( $product[ 'id' ] ) ) ) ) . '">add a new person to this list</a>)',
 | 
				
			||||||
                                           '#description' => 'Tick the box next to each person for whom you want to buy a ticket.',
 | 
					                                           '#description' => 'Tick the box next to each person for whom you want to buy a ticket.',
 | 
				
			||||||
                                           '#options' => $persons,
 | 
					                                           '#options' => $persons,
 | 
				
			||||||
                                           );
 | 
					                                           );
 | 
				
			||||||
@ -580,3 +583,8 @@ function fulcrm_shoppingcart_checkout_failure( $transaction_id, $hmac ) {
 | 
				
			|||||||
        return 'failure';
 | 
					        return 'failure';
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function fulcrm_shoppingcart_user_logout( $account ) {
 | 
				
			||||||
 | 
					    if ( array_key_exists( 'fulcrm_shoppingcart_id', $_SESSION ) )
 | 
				
			||||||
 | 
					        unset( $_SESSION[ 'fulcrm_shoppingcart_id' ] );
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user