getAllHotels(); $hotels = array(); foreach ($allHotels as $hotel) { $response = array(); $response['id'] = $hotel['id']; $response['id_category'] = $hotel['id_category']; $objHotelBranch = new HotelBranchInformation($response['id'], $this->context->language->id); $response['name'] = $objHotelBranch->hotel_name; $response['property_type'] = $this->objModule->l('hotel', 'QcmcChannelManagerProperty'); $response['description'] = $objHotelBranch->description; $response['email'] = $objHotelBranch->email; $response['phone'] = $objHotelBranch->phone; $response['currency'] = Currency::getCurrency($this->context->currency->id)['iso_code']; $response['country_code'] = Country::getIsoById($objHotelBranch->id_country); $response['state'] = State::getNameById($objHotelBranch->id_state); $response['city'] = $objHotelBranch->city; $response['address1'] = $objHotelBranch->address; $response['address2'] = ''; $response['zip_code'] = $objHotelBranch->zipcode; $response['latitude'] = $objHotelBranch->latitude; $response['longitude'] = $objHotelBranch->longitude; $response['timezone'] = Configuration::get('PS_TIMEZONE'); $hotels[] = $response; } return json_encode(array( 'success' => true, 'data' => $hotels )); } }