Back to Example List
Live rate response for home page
var liverate24North = new TTWeb.LiveRate({
hotelId: 'KEY24N', //'NYCREF',
portalId: '24northhotel', //'refineryhotelnewyork',
defaultLocale: 'en',
defaultCurrency: 'USD',
defaultTimezone: 'America/New_York',
ipAddress: sessionStorage.ip_add
});
liverate24North.lowestRateForHome('').then(function(response){
var rates= response;
document.getElementById('homeRateResponse').innerHTML = JSON.stringify(rates, null, 4);
console.log("Home Page Live rate" );
console.log(rates);
}).catch(function(error) {
document.getElementById('homeRateResponse').innerHTML = JSON.stringify(error,null,4);
console.log("Home Page Live rate" );
console.log(error);
});
Response:
Live rate response for all rooms
var liverate24North = new TTWeb.LiveRate({
hotelId: 'KEY24N', //'NYCREF',
portalId: '24northhotel', //'refineryhotelnewyork',
defaultLocale: 'en',
defaultCurrency: 'USD',
defaultTimezone: 'America/New_York',
ipAddress: sessionStorage.ip_add
});
liverate24North.lowestRateForRooms('','').then(function(response){
var rates= response;
document.getElementById('rateResponse').innerHTML = JSON.stringify(rates, null, 4);
console.log("All rooms Live rate" );
console.log(rates);
}).catch(function(error) {
document.getElementById('rateResponse').innerHTML = JSON.stringify(error,null,4);
console.log("All rooms Live rate" );
console.log(error);
});
Response:
Lowest rate response
var liverate24North = new TTWeb.LiveRate({
hotelId: 'KEY24N', //'NYCREF',
portalId: '24northhotel', //'refineryhotelnewyork',
defaultLocale: 'en',
defaultCurrency: 'USD',
defaultTimezone: 'America/New_York',
ipAddress: sessionStorage.ip_add
});
liverate24North.lowestRate().then(function(response){
var rates= response;
document.getElementById('lowestRateResponse').innerHTML = JSON.stringify(rates, null, 4);
console.log("Lowest rate" );
console.log(rates);
}).catch(function(error) {
document.getElementById('lowestRateResponse').innerHTML = JSON.stringify(error,null,4);
console.log("Lowest Rate" );
console.log(error);
});
Response: