From 8679bf5c8a1c4b859fe8810ae3ddf6e513eadd5b Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 2 Aug 2022 19:31:32 +0530 Subject: [PATCH] fixed address missing in order detail --- classes/PaymentModule.php | 2 +- .../hotelreservationsystem/classes/HotelBranchInformation.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index fd3c557a1..205b853bb 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -751,7 +751,7 @@ abstract class PaymentModuleCore extends Module $objBookingDetail->email = $objHotelBranch->email; $objBookingDetail->check_in_time = $objHotelBranch->check_in; $objBookingDetail->check_out_time = $objHotelBranch->check_out; - if ($hotelAddress = $objHotelBranch->getAddress($objCartBkData->id_hotel)) { + if ($hotelAddress = $objHotelBranch->getAddress($objCartBookingData->id_hotel)) { $objBookingDetail->city = $hotelAddress['city']; $objBookingDetail->state = $hotelAddress['state']; $objBookingDetail->country = $hotelAddress['country']; diff --git a/modules/hotelreservationsystem/classes/HotelBranchInformation.php b/modules/hotelreservationsystem/classes/HotelBranchInformation.php index 0d5f94312..a96b6d90b 100644 --- a/modules/hotelreservationsystem/classes/HotelBranchInformation.php +++ b/modules/hotelreservationsystem/classes/HotelBranchInformation.php @@ -376,6 +376,10 @@ class HotelBranchInformation extends ObjectModel if (!$id_lang) $id_lang = Context::getContext()->language->id; + if (!$id_hotel) { + return false; + } + $cache_id = 'hotelBranch::getAddress'.(int)$id_hotel.'-'.(int)$id_lang; if (!Cache::isStored($cache_id)) { $sql = 'SELECT a.*, cl.`name` AS country, s.`name` AS state, s.`iso_code` AS state_iso