From f2bb4519a5b14b85131affea60a4e5663e1f8161 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Thu, 25 Nov 2021 08:40:37 +0100 Subject: [PATCH] Load the appointment and customer data after inserting them for the first time --- application/controllers/Booking.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/controllers/Booking.php b/application/controllers/Booking.php index 1bdcba3f..9e3ea586 100755 --- a/application/controllers/Booking.php +++ b/application/controllers/Booking.php @@ -497,11 +497,12 @@ class Booking extends EA_Controller { // Save customer language (the language which is used to render the booking page). $customer['language'] = session('language') ?? config('language'); $customer_id = $this->customers_model->save($customer); + $customer = $this->customers_model->find($customer_id); $appointment['id_users_customer'] = $customer_id; $appointment['is_unavailable'] = (int)$appointment['is_unavailable']; - $appointment['id'] = $this->appointments_model->save($appointment); - $appointment['hash'] = $this->appointments_model->value($appointment['id'], 'hash'); + $appointment_id = $this->appointments_model->save($appointment); + $appointment = $this->appointments_model->find($appointment_id); $settings = [ 'company_name' => setting('company_name'),