display_column_left = false; $this->display_column_right = false; $result = array('status' => false); $search_data = Tools::getValue('to_search_data'); $location_category_id = Tools::getValue('location_category_id'); $obj_htl_info = new HotelBranchInformation(); if (isset($search_data) && $search_data) { $locationCategories = $obj_htl_info->getHotelCategoryTree($search_data); if ($locationCategories) { $this->context->smarty->assign(array('location_categories' => $locationCategories)); $html = $this->context->smarty->fetch( $this->module->getTemplatePath('location-options.tpl') ); $result['status'] = true; $result['data'] = $html; } } elseif (isset($location_category_id) && $location_category_id) { $locationCategories = Category::getAllCategoriesName($location_category_id); if ($locationCategories) { $hotelsInfo = array(); foreach ($locationCategories as $category) { if ($hotelInfo = $obj_htl_info->hotelBranchInfoByCategoryId($category['id_category'])) { $maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($hotelInfo['id']); $maxOrderDate = date('Y-m-d', strtotime($maxOrderDate)); $minBookingOffset = (int) HotelOrderRestrictDate::getMinimumBookingOffset($hotelInfo['id']); $hotelsInfo[] = array( 'id_hotel' => $hotelInfo['id'], 'id_category' => $hotelInfo['id_category'], 'hotel_name' => $hotelInfo['hotel_name'], 'max_order_date' => $maxOrderDate, 'min_booking_offset' => $minBookingOffset ); } } $this->context->smarty->assign(array('hotels_info' => $hotelsInfo)); $html = $this->context->smarty->fetch( $this->module->getTemplatePath('hotel-options.tpl') ); $result['status'] = true; $result['html_hotel_options'] = $html; } } $this->ajaxDie(json_encode($result)); } }