This page documents the liveRES reservation insert for restaurant bookings. It lists the parameters that can be defined and gives an example insert at the bottom.
The liveRES reservation insert is a javascript insert that can be placed anywhere on your web page. The insert has two parts, the first is for the setup of some variables that depict how the reservation insert operates and looks. The second is the actual script insert itself which is an external javascript file hosted by liveRES. This insert then dynamically generates an html iframe at that position in the web page using the parameters provided. Additionally two of the parameters, _fez_rest and _fez_offer, can be set inside the url of the web page as the url parameters lrm_rest and lrm_offer.
The parameters that can be set within the page are :-
Mandatory. The unique account reference for the liveRES customer. This is obtained from your account representative.
Mandatory. The brand required for the insert. An account can have multiple brands and within each brand multiple restaurants. This determines the brand for the insert and hence the list of restaurants available. The brand code is as entered in the liveRES admin system.
Mandatory. The actual width in pixels of the reservation insert iframe.
Mandatory. The actual height in pixels of the reservation insert iframe.
Mandatory. A full url to the css file to be used to style the reservation insert. The stylesheet controls the look (colour, font, size etc) and placement of the text and inputs on the reservation insert.
Optional. Analysis code to be used in logging. This enables analysis of different reservation inserts to be done. This however will be overridden by the analysis code of the special offer if applied when offer is created in the admin system.
Optional. The partner reference code. This is obtained from your account representative.
Optional. If not defined this is defaulted from the liveRES admin system. This will be overridden by the booking source of the special offer.
Optional. The code is generated in the liveRES admin system and can be obtained by your liveRES administrator. This variable can also be set from the url parameter lrm_offer in the hostpage, e.g. If the page that contains the liveRES insert is at http://www.site.com/bookings.html?someparam&lrm_offer=999 then the offer code will be set to 999. If this offer is not available either because of dates or it does not exist then an appropriate error message is produced in the reservation insert iframe.
Optional. Flag to say if the offer text appears in a popup overlay with the ability to open and close it. Ideally used on frames with limited space. 1 = on 0 =off (Default is set on)
Optional. Flag to turn on the offer picker. If this is set then the offer picker function is enabled. 1 = on 0 = off (Default is set on) only applicable with multiple offers.
Optional. Flag to turn on the choose full price option in the time dropdown when an offer is shown. The text displayed is as set up in the chooseFullPriceOfferText option in the admin system, if this is not set the text "Book Full Price" is used. 1 = on 0 = off (Default is set on)
Optional. The initial offer pop up text is enabled to have a full price option before entering into the offer. The text displayed is as set up in the offerPopupFullPriceText option in the admin system, which can be amended. If this is not set, the text "If we don t have the date and time on this offer that you require click here to switch to full price availability" is used. 1 = on 2 = off (Default is set on)
Optional. This can be used to limit the list of restaurants required within the restaurant dropdown. The restaurant code is within the admin system or can be obtained by your liveRES representative. This variable can also be set from the url parameter lrm_rest in the hostpage, e.g. If the page that contains the liveRES insert is at http://www.site.com/bookings.html?lrm_rest=ABC then the restaurant code will be set to ABC.
Optional. Flag to turn on the restaurant picker. If this is set and the _fez_rest variable is empty then the restaurant picker function is enabled. 1 = on 0 = off (Default is set on) NB this needs to be styled in the css.
Optional. The scrollable nature of the reservation inserts iframe. "yes" means it will enable scroll bars if the reservation insert produced is longer or wider than the iframe. "no" means it will not. (The default is no)
Optional. The text to display in the header of the reservation insert.
Optional. The description to display under the header. NB Not Yet Implemented!
Optional. Flag to make the requests field mandatory. 1 = mandatory 0 = not mandatory (Default is set off)
Optional. The text to appear next to the requests prompt, and for the error message if requests are blank and _fez_requestsmandatory is set to 1. NB if a css uses an image to show the requests text, as is standard on the liveRES MPU units, then this is not changed.
Optional. liveRES uses a cookie to store the last visit, together with any booking details like name, email etc. These are then used to prepopulate the details the next time the user visits. If this is set to 1, a cookie is not written to and not read from. If the cookie already exists it will not be deleted. 1 = off 0 = on (Default is set on)
Optional. Use this to pre populate the title dropdown with data - e.g. from your membership system if a user has logged in. Valid entries are Mr, Mrs, Miss, Ms
Optional. Use this to pre populate the forename field with data - e.g. from your membership system if a user has logged in.
Optional. Use this to pre populate the surname field with data - e.g. from your membership system if a user has logged in.
Optional. Use this to pre populate the telephone field with data - e.g. from your membership system if a user has logged in.
Optional. Use this to pre populate the email field with data - e.g. from your membership system if a user has logged in.
Optional. Use this to pre populate the requests field with data - e.g. from your membership system if a user has logged in.
Optional. Use this to show the enquiry prompts inline on the page rather than as a popup. NB this needs the enquiries functionality switched on. 1 = on 0 = off (Default is set on).
Optional. Use this to set a description to appear below the enquiries covers header. This text appears in a span with id = coversEnqText and class inlineText. The default is empty text is to be added with the parameter.
Optional. Use this to set a description to appear below the enquiries times header. This text appears in a span with id = timesEnqText and class inlineText. The default is empty text is to be added with the parameter.
Optional. Use this to set a description to appear below the enquiries covers header when using the enquiries popup form. This text appears in a span with id = lblEnqCvrsMsg and class enquiryMsg. The default is "If you wish to book for more people than we are we are offering please enter the numbers below. Your booking will be treated as an enquiry and not a confirmed booking.
Optional. Use this to set a description to appear below the enquiries times header when using the enquiries popup form. This text appears in a span with id = lblEnqTimeMsg and class enquiryMsg. The default is "You have chosen to pick a time other than one we are offering, please note that this will make your booking an enquiry only."
Optional. Use this to turn on a popup message when no times are found. If this is set to 1 then when the times dropdown is populated (once restaurant,session,covers,date,menu are chosen) if there are no times available it will also produce a popup with the same message as shown in the times dropdown. This can be amended within the liveRES admin system 1 = on 0 = off (Default is set off). NB this may need to be styled in the css.
Optional. Use this to turn on the phone number prefix dropdown for international phone prefixes. The default selection will be the phone prefix of the restaurant chosen. 1 = on 0 = off (Default is set off)
Optional. Use this change the wording of the marketing tick box label - The default for this text is "I would like to receive offers via email." Text is to be added within the parameter: _fez_marketingtext = text goes here ;
Optional. Flag to say if the marketing message for a day appears in a popup overlay with the ability to close it. If this is not set then the marketing title will just appear as a tooltip for the date in the calendar. 1 = on 0 = off (Default is set on)
Optional. Use this if you require additional scripts loading into the booking unit. This is a javascript array, with an entry per script you want loading. An example use of this is to hook into the time selected event by including a script that includes a function "function liveREStimeSelectEvent(rest,dte,people) {}". This can then be used in conjunction with _fez_scriptinsert to track a user s journey through the unit.
Optional. Use this to turn on the Find next functionality. A value of 1 turns it on as a button before the calendar. 2 = turn it on as an option in the times dropdown. 3 = turn it on for both. NB options 1 and 3 are not suitable for units with menus switched on.
Optional. Turn on the facebook share button on the booking confirmation page. A value of 1 will turn this on and present a button on the booking confirmation page that allows the user to share a message to facebook. The message is of the form "I have just booked a table at {restaurant name}, {restaurant address} On {date} {time}.
Optional. Set the image to use on the facebook share.
Optional. Set the URL for the facebook share, if this is not set, or set to "" then it uses the url of the page the booking unit is on.
Optional. Set the caption for the message. If this is not set then the restaurant address is used. If it is set to "" then it uses the url of the page. If you want this to be blank set it to a space.
Optional. Set the description for the message. If this is not set then the restaurant name is used. If you want this to be blank, set this to ""
Example insert that uses one of our standard stylesheets
The script parameters are:-
<script type="text/javascript">
<!--
_fez_account = "44dab3cc-0f1e-480e-bb16-748eb7607d4b";
_fez_brand = "1";
_fez_rest = "";
_fez_width = "100%";
_fez_height = "100%";
_fez_scrolling = "no";
_fez_anal = "";
_fez_stylesheet = "http://bookings.liveres.co.uk/css/responsive_demo1.css";
_fez_mobile = "no";
_fez_ascript = "0";
_fez_head = "Table Reservation";
_fez_desc = "";
_fez_offer = "";
_fez_offerpopup = "1";
_fez_partner = "";
_fez_restaurantpicker = "";
_fez_daymarketingpopup = "1";
_fez_offerpicker = "";
_fez_offerpopupchoosefullprice = "1";
_fez_choosefullprice = "1";
-->
</script>
Then the following insert:-
<script type="text/javascript" src="http://bookings.liveres.co.uk/scripts/fez.js"></script>
Insert the above script that sets all the variables, but instead of the fez.js insert use the following insert :-
<script type="text/javascript" src="http://bookings.liveres.co.uk/scripts/bookit.js"></script>
liveRES recommend that SSL be used. The liveres service has an SSL certificate on the liveres.co.uk domain. SSL is switched on if you use https for the fez.js or bookit.js script above e.g.
<script type="text/javascript" src="https://bookings.liveres.co.uk/scripts/fez.js"></script>
NB If you use https then any stylesheet, and images used within the stylesheet should also be served from https.
Injecting Javascript into the widget is simple. Using the _fez_scriptinsert parameter you are able to provide an array of URL's referencing your hosted JS files.
The example below shows how to include jQuery in your setup:
_fez_scriptinsert = "['https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js','https://yourdomain.com/path/to/file/yourscript.js']";
To get started writing your script, init using the snippet of code below:
window.onload = function() {
// Start writing your bespoke functions here!
};
Step 1 - Log in to your WordPress admin area and navigate to the page you wish to embed the widget onto
Step 2 - Check that you're editing the page in text mode:
Step 3 - Paste in the code provided by your liveRES account manager. This should look like the code in the section above
Step 4 - Click the update button before checking that the widget is now visible on your website
Step 1 - Navigate to the website editor and select the page you wish to add the widget to
Step 2 - Click Add ⊕ on the left side of the Editor.
Step 3 - Click More.
Step 4 - Click HTML iframe, or drag it the relevant location on your page.
Step 5 - Paste in the code provided by your liveRES account manager. This should look like the code in the section above
Step 6 - Click Apply.
Step 7 - Position and resize the widget accordingly
Mobile web browser detection script.
We recommend you use server code to detect a mobile browser and to then redirect to the mobile web site. Example asp.net c# code, asp.net vb.net code and php code are provided. You will need to set up to three variables inside the code. Inline comments provide instruction for this.
Alternatively if you are not able to change the backend code of the site you can add a few lines of javascript to the head section of your pages.
<script type="text/javascript">
_liveres_mobilesitename = "{brand name}";
_liveres_restcode = "{restaurant code or blank}";
_liveres_offercode = "{offer code or blank}";
</script>
<script type="text/javascript" src="http://bookings.liveres.co.uk/scripts/mobiledetect.js"></script>
Place the above javascript into the head section of your page replacing {brand name} with your appropriate brands mobile site name. If you wish to redirect to a specific restaurant page then also replace {restaurant code} with the restaurant code, otherwise leave this blank. If you wish to redirect to a specific offer then replace both {restaurant code} and {offer code} with the relevant codes, otherwise leave the offer code blank.
If the user has clicked on the "full Site" link on the mobile web site, each of the above will place a cookie which then stops the redirection to the mobile site for 30 minutes. This enables linking back to the main site from the mobile site without it trying to redirect again.
Offer Advertisement insertion script
The LiveRES offer advertisement insert is a javascript insert that can be used by an ad network and placed anywhere on a web page. The insert has two parts, the first is for the setup of some variables that depict how the reservation insert operates and looks. The second is the actual script insert itself which is an external javascript file hosted by LiveRES. This insert then dynamically generates an html iframe at that position in the web page using the parameters provided.
The parameters that can be set within the page are :-
Mandatory. The unique account reference for the LiveRES customer. This is obtained from your account representative.
Mandatory. The brand required for the insert. An account can have multiple brands and within each brand multiple restaurants. This determines the brand for the insert and hence the list of offers available. The brand code is as entered in the LiveRES admin system.
Mandatory. The URL to link to when an offer is clicked. This url will be appended with the offer code chosen - e.g. "www.restaurantsite.com/offerspage?offercode="
Optional. The actual width in pixels of the offer advertisement insert iframe. The default is the leaderboard width of 728.
Optional. The actual height in pixels of the offer advertisement insert iframe. The default is the leaderboard height of 90.
Optional. The scrollable nature of the offer advertisement insert iframe. "yes" means it will enable scroll bars if the insert produced is longer or wider than the iframe. "no" means it will not. The default is no.
Optional. A full url to a css file to be used to style the offer advertisement insert. The stylesheet works in conjunction with the script and controls the look (colour, font, size etc) and placement of the text and images on the insert. The default is the leaderboard1.css
Optional. A full url to a script file to be used on the offer advertisement insert. The script adds capabilities such as scrolling and animation to the insert. The default is the leaderboard1.js which provides a horizontal carousel and animation of the offer description.
Optional. A full url to an image file to be used on the offer advertisement insert header.
Optional. Text to be used on the offer advertisement insert header.
NB the actual url for the javascript insert is not as specified in this page as this is the example site. Your support representative will issue the live url at time of implementation!
Example insert that uses our standard leaderboard carousel style and script
The script parameters are:-
<script type="text/javascript">
<!--
var _liveres_account = "20e64333-86dc-45fd-ade6-975145781c84";
var _liveres_brand = "1";
var _liveres_image = "http://test.liveres.co.uk/images/example1.jpg";
var _liveres_stylesheet = "http://test.liveres.co.uk/css/offerads_leaderboard1.css";
var _liveres_script = "http://test.liveres.co.uk/scripts/offerads_leaderboard1.js";
var _liveres_linkurl = "http://test.liveres.co.uk/offerdemo.htm?offercode=";
var _liveres_height = "90";
var _liveres_width = "728";
-->
</script>
Then the following insert:-
<script type="text/javascript" src="http://test.liveres.co.uk/scripts/liveresoffers.js"></script>
To get the exact syntax please view the page source.