4 * Class CRM_Event_Cart_Form_Checkout_ThankYou
6 class CRM_Event_Cart_Form_Checkout_ThankYou
extends CRM_Event_Cart_Form_Cart
{
7 public $line_items = NULL;
10 public function buildLineItems() {
11 foreach ($this->cart
->events_in_carts
as $event_in_cart) {
12 $event_in_cart->load_location();
14 $line_items = $this->get('line_items');
15 foreach ($line_items as $line_item) {
16 $event_in_cart = $this->cart
->get_event_in_cart_by_event_id($line_item['event_id']);
18 $not_waiting_participants = [];
19 foreach ($event_in_cart->not_waiting_participants() as $participant) {
20 $not_waiting_participants[] = [
21 'display_name' => CRM_Contact_BAO_Contact
::displayName($participant->contact_id
),
24 $waiting_participants = [];
25 foreach ($event_in_cart->waiting_participants() as $participant) {
26 $waiting_participants[] = [
27 'display_name' => CRM_Contact_BAO_Contact
::displayName($participant->contact_id
),
31 $line_item['event'] = $event_in_cart->event
;
32 $line_item['num_participants'] = count($not_waiting_participants);
33 $line_item['participants'] = $not_waiting_participants;
34 $line_item['num_waiting_participants'] = count($waiting_participants);
35 $line_item['waiting_participants'] = $waiting_participants;
36 $line_item['location'] = $event_in_cart->location
;
37 $line_item['class'] = $event_in_cart->event
->parent_event_id ?
'subevent' : NULL;
39 $this->sub_total +
= $line_item['amount'];
40 $this->line_items
[] = $line_item;
42 $this->assign('line_items', $this->line_items
);
45 public function buildQuickForm() {
48 $template_params_to_copy = [
52 'billing_postal_code',
54 'billing_street_address',
55 'credit_card_exp_date',
59 foreach ($template_params_to_copy as $template_param_to_copy) {
60 $this->assign($template_param_to_copy, $this->get($template_param_to_copy));
62 $this->buildLineItems();
63 $this->assign('discounts', $this->get('discounts'));
64 $this->assign('events_in_carts', $this->cart
->events_in_carts
);
65 $this->assign('transaction_id', $this->get('trxn_id'));
66 $this->assign('transaction_date', $this->get('trxn_date'));
67 $this->assign('payment_required', $this->get('payment_required'));
68 $this->assign('is_pay_later', $this->get('is_pay_later'));
69 $this->assign('pay_later_receipt', $this->get('pay_later_receipt'));
70 $this->assign('sub_total', $this->sub_total
);
71 $this->assign('total', $this->get('total'));
72 // XXX Configure yourself
73 //$this->assign( 'site_name', "" );
74 //$this->assign( 'site_contact', "" );
77 public function preProcess() {
78 $this->event_cart_id
= $this->get('last_event_cart_id');
80 //$this->loadParticipants( );