@@ -62,7 +62,6 @@ public function test_page( $attributes ) {
6262 false
6363 );
6464
65-
6665 $ ebi = new EduAdmin_BookingInfo ( $ event_booking , $ _customer , $ _contact );
6766
6867 if ( ! empty ( EDU ()->session ['klarna-order-id ' ] ) && ! empty ( $ _GET ['klarna_order_id ' ] ) && EDU ()->session ['klarna-order-id ' ] === $ _GET ['klarna_order_id ' ] ) {
@@ -196,14 +195,36 @@ public function create_checkout( $ebi = null ) {
196195
197196 $ reference_id = 0 ;
198197
198+ $ _event = null ;
199+
199200 if ( ! empty ( $ ebi ->EventBooking ['BookingId ' ] ) ) {
200- $ booking_id = intval ( $ ebi ->EventBooking ['BookingId ' ] );
201+ $ booking_id = intval ( $ ebi ->EventBooking ['BookingId ' ] );
201202 $ reference_id = $ booking_id ;
203+
204+ $ _event = EDUAPI ()->OData ->Events ->GetItem ( $ ebi ->EventBooking ['EventId ' ] );
202205 }
203206
204207 if ( ! empty ( $ ebi ->EventBooking ['ProgrammeBookingId ' ] ) ) {
205208 $ programme_booking_id = intval ( $ ebi ->EventBooking ['ProgrammeBookingId ' ] );
206- $ reference_id = $ programme_booking_id ;
209+ $ reference_id = $ programme_booking_id ;
210+
211+ $ _event = EDUAPI ()->OData ->ProgrammeStarts ->GetItem ( $ ebi ->EventBooking ['ProgrammeStartId ' ] );
212+ }
213+
214+ $ rowExtraInfo = "" ;
215+
216+ if ( null != $ _event ) {
217+ if ( ! empty ( $ _event ['City ' ] ) ) {
218+ $ rowExtraInfo .= '; ' . $ _event ['City ' ];
219+ }
220+
221+ if ( ! empty ( $ _event ['StartDate ' ] ) ) {
222+ $ rowExtraInfo .= '; ' . date ( "Y-m-d " , strtotime ( $ _event ['StartDate ' ] ) );
223+ }
224+
225+ if ( ! empty ( $ _event ['EndDate ' ] ) ) {
226+ $ rowExtraInfo .= '; ' . date ( "Y-m-d " , strtotime ( $ _event ['EndDate ' ] ) );
227+ }
207228 }
208229
209230 $ confirmation_url = add_query_arg (
@@ -233,7 +254,7 @@ public function create_checkout( $ebi = null ) {
233254
234255 $ create ['merchant ' ] = $ merchant ;
235256
236- $ create ['merchant_reference ' ] = array ();
257+ $ create ['merchant_reference ' ] = array ();
237258 $ create ['merchant_reference ' ]['orderid1 ' ] = $ reference_id ;
238259 $ create ['merchant_reference ' ]['orderid2 ' ] = $ reference_id ;
239260
@@ -244,7 +265,7 @@ public function create_checkout( $ebi = null ) {
244265 $ cart_item = array ();
245266
246267 $ cart_item ['reference ' ] = $ order_row ['ItemNumber ' ];
247- $ cart_item ['name ' ] = $ order_row ['Description ' ];
268+ $ cart_item ['name ' ] = $ order_row ['Description ' ] . $ rowExtraInfo ;
248269 $ cart_item ['quantity ' ] = intval ( $ order_row ['Quantity ' ] );
249270
250271 if ( ! $ order_row ['PriceIncVat ' ] ) {
0 commit comments