2 class CRM_Event_Cart_Form_Checkout_ThankYou
extends CRM_Event_Cart_Form_Cart
{
3 public $line_items = NULL;
6 function buildLineItems() {
7 foreach ($this->cart
->events_in_carts
as $event_in_cart) {
8 $event_in_cart->load_location();
10 $line_items = $this->get('line_items');
11 foreach ($line_items as $line_item) {
12 $event_in_cart = $this->cart
->get_event_in_cart_by_event_id($line_item['event_id']);
14 $not_waiting_participants = array();
15 foreach ($event_in_cart->not_waiting_participants() as $participant) {
16 $not_waiting_participants[] = array(
17 'display_name' => CRM_Contact_BAO_Contact
::displayName($participant->contact_id
),
20 $waiting_participants = array();
21 foreach ($event_in_cart->waiting_participants() as $participant) {
22 $waiting_participants[] = array(
23 'display_name' => CRM_Contact_BAO_Contact
::displayName($participant->contact_id
),
27 $line_item['event'] = $event_in_cart->event
;
28 $line_item['num_participants'] = count($not_waiting_participants);
29 $line_item['participants'] = $not_waiting_participants;
30 $line_item['num_waiting_participants'] = count($waiting_participants);
31 $line_item['waiting_participants'] = $waiting_participants;
32 $line_item['location'] = $event_in_cart->location
;
33 $line_item['class'] = $event_in_cart->event
->parent_event_id ?
'subevent' : NULL;
35 $this->sub_total +
= $line_item['amount'];
36 $this->line_items
[] = $line_item;
38 $this->assign('line_items', $this->line_items
);
41 function buildQuickForm() {
44 $template_params_to_copy = array(
48 'billing_postal_code',
50 'billing_street_address',
51 'credit_card_exp_date',
55 foreach ($template_params_to_copy as $template_param_to_copy) {
56 $this->assign($template_param_to_copy, $this->get($template_param_to_copy));
58 $this->buildLineItems();
59 $this->assign('discounts', $this->get('discounts'));
60 $this->assign('events_in_carts', $this->cart
->events_in_carts
);
61 $this->assign('transaction_id', $this->get('trxn_id'));
62 $this->assign('transaction_date', $this->get('trxn_date'));
63 $this->assign('payment_required', $this->get('payment_required'));
64 $this->assign('is_pay_later', $this->get('is_pay_later'));
65 $this->assign('pay_later_receipt', $this->get('pay_later_receipt'));
66 $this->assign('sub_total', $this->sub_total
);
67 $this->assign('total', $this->get('total'));
68 // XXX Configure yourself
69 //$this->assign( 'site_name', "" );
70 //$this->assign( 'site_contact', "" );
73 function preProcess() {
74 $this->event_cart_id
= $this->get('last_event_cart_id');
76 //$this->loadParticipants( );