This component allows registering a user in the system.
The container defined by the container property determines the component’s width.
Parameters*
Main parameters
Parameter | Description | Example |
webSessionId | Unique web session identifier. It is used to persist the user’s session across components and pages. | 01CDA38719E74937A2F275757ABA34EE |
bookingEngine | Booking Engine code | 2 |
system | System Code - HPH: Desktop
- MPH: Mobile
- CCH: Call Center
- B2B: B2B
| HPH |
language | Language | es |
protectionDataUrl | Page where the data protection information is located. | /proteccion-datos.html |
okHandler | Function that is called when registration completes successfully and returns an object containing the user’s information. | registerOk |
component | Fixed value “customer-register” | customer-register |
container | ID of the HTML element that will serve as the component’s container. | registerUser |
extraFields | Array of optional fields to include in the registration form (all available values are listed in the “Example” column). | document.type, document.number, phone.number, address, city, province, postal.code |
* Any parameters that aren’t fixed must be replaced with the appropriate values at runtime, based on the type of search being performed.
Example of HTML Commented with Required Information
<script> function registerOk() { // For example, you could redirect the user to a landing page. }
// Component parameters var genericManifestAndVendorsLoaded = genericManifestAndVendorsLoaded || false; var clientComponents = clientComponents || []; var firstClientComponent = clientComponents.length; clientComponents.push({ webSessionId: "01CDA38719E74937A2F275757ABA34EE", bookingEngine: "2", system: "HPH", language: "es", protectionDataUrl: "/proteccion-datos.html", okHandler: registerOk, component: "customer-register", container: "registerUser", extraFields: ["document.type", "document.number", "phone.number", "address", "city", "province", "postal.code"] });
if(typeof gethTtScript != 'function'){ window.gethTtScript = function(source){ var script = document.createElement('script'); var prior = document.getElementsByTagName('script')[0]; script.async = 1; script.src = source; prior.parentNode.insertBefore(script, prior); }; }
if (firstClientComponent == 0) { document.addEventListener('DOMContentLoaded', function () { window.parameters = window.parameters || {}; window.parameters.clientComponents = clientComponents;
window.gethTtScript("https://hotel.new.hotetec.com/components/customer/js/main.js"); }); } if (!genericManifestAndVendorsLoaded) { window.gethTtScript("https://hotel.new.hotetec.com/components/js/vendors.js"); window.gethTtScript("https://hotel.new.hotetec.com/components/js/manifest.js"); genericManifestAndVendorsLoaded = true; } </script>
<div id="registerUser"></div> |