@@ -485,6 +485,7 @@ public function renderForm()
485485 'advance_payment_amount_without_tax ' => $ cart ->getOrderTotal (false , Cart::ADVANCE_PAYMENT ),
486486 'advance_payment_amount_with_tax ' => $ cart ->getOrderTotal (true , Cart::ADVANCE_PAYMENT ),
487487 'cart ' => $ cart ,
488+ 'customer ' => $ cart ->id_customer ? new Customer ($ cart ->id_customer ): null ,
488489 'currencies ' => Currency::getCurrenciesByIdShop (Context::getContext ()->shop ->id ),
489490 'langs ' => Language::getLanguages (true , Context::getContext ()->shop ->id ),
490491 'payment_modules ' => $ payment_modules ,
@@ -3593,10 +3594,11 @@ public function renderView()
35933594 }
35943595 }
35953596
3596- $ messages = array_merge ($ customerMessages , $ messages );
3597- usort ($ messages , function ($ a , $ b ) {
3598- return strtotime ($ a ['date_add ' ]) < strtotime ($ b ['date_add ' ]);
3599- });
3597+ if ($ messages = array_merge ($ customerMessages , $ messages )){
3598+ usort ($ messages , function ($ a , $ b ) {
3599+ return (strtotime ($ a ['date_add ' ]) < strtotime ($ b ['date_add ' ])) ? 1 : -1 ;
3600+ });
3601+ }
36003602 }
36013603
36023604 // send hotel standalone and standalone products
@@ -7489,7 +7491,7 @@ public function ajaxProcessUpdateSelectedRoomServices()
74897491 $ response ['hasError ' ] = true ;
74907492 $ response ['errors ' ][] = Tools::displayError ('Invalid quantity provided for service ' ).': ' .$ objServiceProductOrderDetail ->name ;
74917493 }
7492- } elseif ($ serviceQuantities [$ idRoomTypeServiceProductOrderDetail ] > 1 ) {
7494+ } elseif (is_array ( $ serviceQuantities ) && isset ( $ serviceQuantities [ $ idRoomTypeServiceProductOrderDetail ]) && $ serviceQuantities [$ idRoomTypeServiceProductOrderDetail ] > 1 ) {
74937495 $ response ['hasError ' ] = true ;
74947496 $ response ['errors ' ][] = Tools::displayError ('Can not order multiple quanitity for service ' ).': ' .$ objServiceProductOrderDetail ->name ;
74957497 }
@@ -7510,7 +7512,11 @@ public function ajaxProcessUpdateSelectedRoomServices()
75107512 $ result = true ;
75117513 foreach ($ selectedServicesOrderDetails as $ idRoomTypeServiceProductOrderDetail ) {
75127514 $ objServiceProductOrderDetail = new ServiceProductOrderDetail ($ idRoomTypeServiceProductOrderDetail );
7513- $ quantity = $ serviceQuantities [$ idRoomTypeServiceProductOrderDetail ];
7515+ if (is_array ($ serviceQuantities ) && isset ($ serviceQuantities [$ idRoomTypeServiceProductOrderDetail ])) {
7516+ $ quantity = (int )$ serviceQuantities [$ idRoomTypeServiceProductOrderDetail ];
7517+ } else {
7518+ $ quantity = 1 ;
7519+ }
75147520 $ unitPrice = $ serviceUnitPrices [$ idRoomTypeServiceProductOrderDetail ];
75157521
75167522 $ objHotelBookingDetail = new HotelBookingDetail ($ objServiceProductOrderDetail ->id_htl_booking_detail );
0 commit comments