diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index c7f78a128..39422311b 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -73,23 +73,25 @@ class HotelReservationSystem extends Module date('d-m-Y', strtotime(date('Y-m-d', time()).' + 1 year')) ); } - /*To remove room from cart before todays date*/ - if (isset($this->context->cart->id) && $this->context->cart->id) { - $htlCart = new HotelCartBookingData(); - if ($cartBookingData = $htlCart->getCartBookingDetailsByIdCartIdGuest( - $this->context->cart->id, - $this->context->cart->id_guest, - $this->context->language->id - )) { - foreach ($cartBookingData as $cartRoom) { - if (strtotime($cartRoom['date_from']) < strtotime(date('Y-m-d'))) { - $htlCart->deleteRoomDataFromOrderLine( - $cartRoom['id_cart'], - $cartRoom['id_guest'], - $cartRoom['id_product'], - $cartRoom['date_from'], - $cartRoom['date_to'] - ); + if (!Configuration::get('PS_CATALOG_MODE')) { + /*To remove room from cart before todays date*/ + if (isset($this->context->cart->id) && $this->context->cart->id) { + $htlCart = new HotelCartBookingData(); + if ($cartBookingData = $htlCart->getCartBookingDetailsByIdCartIdGuest( + $this->context->cart->id, + $this->context->cart->id_guest, + $this->context->language->id + )) { + foreach ($cartBookingData as $cartRoom) { + if (strtotime($cartRoom['date_from']) < strtotime(date('Y-m-d'))) { + $htlCart->deleteRoomDataFromOrderLine( + $cartRoom['id_cart'], + $cartRoom['id_guest'], + $cartRoom['id_product'], + $cartRoom['date_from'], + $cartRoom['date_to'] + ); + } } } }