Skip to main content

Configuration

By default, the Best Price widget will display the best available lead price for the next 30 days starting with “today,” but alternate start and end dates may be provided to show the lead price for any date range. Parameters exist to specify guest occupancy, length of stay, and to filter the lead price to a specific room, rate, or access codes.  An "OnlyCheckRequested" option exists to specify whether to include public rates in the lead price calculation with specifically requested rates or to calculate based only on the filtered rates.

Configuration Options

Property Type RequiredDefault Description 

api 

string 

yes 

API key 

chain 

string 

yes 

SynXis CRS Chain ID 

hotel 

string 

yes 

SynXis CRS Hotel ID 

currency 

string 

yes 

ISO Currency Code. Only products setup in SynXis CR with pricing in this currency will be considered in the price calculation.

locale 

string 

(browser locale) 

Locale to use for number/currency format.  Defaults to the guest's browser locale.  ISO Code (e.g. "en-US")

env 

enum

ccrs 

The SHS environment from which to pull pricing: 
ccrs -  CCRS Environment 
cuat - CUAT Environment 

primary-channel 

string 

WEB 

Primary channel to use when pulling data from SynXis CR.  Default WEB is for Booking Engine channel. 

secondary-channel 

string 

GC 

Secondary channel to use when pulling data from SynXis CR.  Default GC is for Booking Engine secondary channel. 

adult 

number 

Number of adults used in the pricing calculation

child 

number 

Number of children used in the pricing calculation.

child-ages 

JSON array 

Array of child ages used in the price calculation (e.g. '[1, 8]')

length-of-stay 

number 

Length of stay used in the pricing calculation

start-date 

string 

 

(today) 

Custom starting date (YYYY-MM-DD) for the date range to search. 

end-date 

string 

(today + 1 month) 

Custom ending date (YYYY-MM-DD) for the date range to search. 

arrival-date 

string 

 

(empty) 

A preselected arrival date (YYYY-MM-DD), if known. If populated, this will be used as the arrival date in the SBE redirect URL. 

departure-date 

string 

(empty) 

A preselected departure date (YYYY-MM-DD), if known. If populated, this will be used as the departure date in the SBE redirect URL. 

rooms 

number 

Number of rooms used in the pricing calculation 

room-list 

JSON array 

Optional Array of room codes to unlock and/or filter by, e.g. '["A1K","S1K"]' 

rate-list 

JSON array 

Optional Array of rate codes to unlock and/or filter by, e.g. '["AAA","AARP"]' 

access-code 

string 

Optional Access code value to filter price - if present, the access-code-type field is required. 

access-code-type 

enum

Access code type - if present, the access-code value is required.  Valid values:
Promotion - promotion or corporate code
Group - group code

iata-number 

string 

TA agency or IATA number.  Include rates assigned to the IATA number in the pricing calculation. 

only-check-requested 

bool 

false

If true, pricing will be based only on products matching the filtering criteria (access codes, iata, room/rate codes, etc...).  If false, pricing will consider public rates along with rates "unlocked" by the filtered criteria.

include-taxes 

bool 

false

If true, the displayed price will include taxes and fees.

price-type 

enum

Minimum

CRS price type to display:
Minimum - lowest price
Maximum - highest price
Average - average price

sbe-redirect 

bool 

true 

If true, clicking on the best-price widget will redirect the guest to the SynXis Booking Engine using the same stay parameters set in the widget configuration. If false, the widget will not be clickable.

sbe-extra-params 

JSON Array 

 

A JSON Array of JSON objects containing name/value pairs to add as additional parameters to the SBE Redirect URL. e.g. '[{"name":"level","value":"chain"}]'  Note in this example &level=chain will be added to the redirect URL.

sbe-custom-url 

domain name 

If the hotel uses a white label URL with SBE, the white label domain (including https://, but not including path info) should be specified here.

on-click 

global function name 

Name of globally available function the widget will call when a user clicks on the widget.  If present, the widget will display as a button.  If not present, the widget will display as text only. 

Arguments passed to the function include:  
bestPrice – object containing information related to the best priced product 
props – object containing properties representing the current state of the best price widget  

on-error 

func 

Name of a global function triggered if there is an error pulling data from SynXis services. 

Arguments passed:
error  - the exception or service error response
props  – object containing properties representing the current state of the best price widget 

render-spinner 

string 

A Lodash render template to override the rendering of the default spinner.  No variables are supported with this template. 

render-price 

string 

A Lodash render template to override the price display. 

Template Variables:  
price – object containing information related to the best priced product 
includeTaxes – Boolean indicating if taxes and fees are included in the price.  
locale – ISO Locale Code. 
t - Function to retrieve text labels by label key 

render-not-available 

string 

A Lodash template to override display when there is no availability. 

Template Variables:  
t - Function to retrieve text labels by label key 

labels 

JSON object 

A JSON object string containing label keys and text values to override default label text.  See Labels section below for a list of all supported keys and default text. 

Note: At present, default translations exist only for the English language.  If text must be displayed in another language, all label values should be overridden with the translated text.  A future enhancement will provide default translations for all CRS supported languages, and allow label text to be managed in the BE Designer application.

 

Default Labels

The following JSON String is a list of all labels used by the Best Price Widget.  Any or all of these may be translated or overridden using the “labels” parameter in the widget definition. 

{ 
    "shs-widgets--best-price.includingTaxes": "Including taxes and fees", 
    "shs-widgets--best-price.excludingTaxes": "Excluding taxes and fees", 
    "shs-widgets--best-price.notAvailable": "Not available" 
} 

At present default labels are only provided in English.  If the widget needs to be displayed in other languages, then all label values should be overridden with the desired translation.  A future enhancement will provide defaults in all CRS-supported languages and allow them to be customized through the BE Designer application in SynXis Control Center. 

If Render Templates are used, custom label key value pairs may be added to the labels object and referenced in Render Templates using the "t" function (e.g. t("my-custom-label") ).

Events

The Best Price widget supports one event that is fired when the button is clicked.  Applications may subscribe to the event using the window.addEventListener() method, passing in the event id and a function to handle the event.

A "data" argument is passed to the event handler containing event data.  An object is included in the event data named "details" containing state information for the widget, such as the applicable rate code and price being displayed. 

Event ID:  shs-widgets-best-price__on-click

Event Fired: When a user clicks the widget button.

Example:

window.addEventListener('shs-widgets-best-price__on-click', function (data) { 
    console.log(data.details)
});