Skip to main content

Best Price Widget

1.0.0
Widget
Try Now

Best Price Widget - Configuration Options

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 and to filter the lead price to 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  Required  Default  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) 

end-date 

string 

(today + 1 month) 

Custom ending date (YYYY-MM-DD) 

rooms 

number 

Number of rooms used in the pricing calculation 

rate-list 

JSON array 

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

room-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

sbeCustomUrl 

domain name 

If the hotel uses a white label URL with SBE, the white label domain (including https://) can be specified here to use the white label domain instead of the default SynXis domain.

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)
});