Fix PHP warning issue in catalog mode
This commit is contained in:
@@ -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']
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user