INHALTSVERZEICHNIS
- Widget CDN URLs
- What is this Widget?
- Quick Start
- Complete Example
- Configuration Options
- How It Works
- WordPress Integration
- Troubleshooting
- Versions
Widget CDN URLs
Environment | Base URL |
|---|---|
Production |
|
What is this Widget?
The KMS Search Widget is a rental car search form that can be embedded on any website. It allows the customer's visitors to search for available vehicles by selecting a location, dates, and times. When they submit the form, they are redirected to the customer's rental booking page with the search parameters pre-filled.
Quick Start
Add these lines to the customer's HTML page:
<!-- In the <body> where the widget should appear -->
<kms-search-widget route="https://your-shop.com/rent"></kms-search-widget>
<!-- Before closing </body> tag -->
<script src="https://search-rent-widget.azurewebsites.net/{version}/browser/polyfills.js" type="module"></script>
<script src="https://search-rent-widget.azurewebsites.net/{version}/browser/main.js" type="module"></script> Note: Replace
https://your-shop.com/rentwith the actual URL of the customer's shop. Replace{version}with the actual version number.
Complete Example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>My Website</title>
</head>
<body>
<header>
<h1>Welcome to Our Car Rental</h1>
</header>
<main>
<!-- Place the widget where you want it to appear -->
<kms-search-widget route="https://your-shop.com/rent" language="de-de"></kms-search-widget>
</main>
<!-- Widget scripts (load at the end of body) -->
<script src="https://search-rent-widget.azurewebsites.net/1.0.0/browser/polyfills.js"></script>
<script src="https://search-rent-widget.azurewebsites.net/1.0.0/browser/main.js"></script>
</body>
</html>Configuration Options
The <kms-search-widget> element accepts the following attributes:
Required Attributes
Attribute | Description | Example |
|---|---|---|
| The URL where users will be redirected after searching. This should be the customer's rental booking page. |
|
Optional Attributes
Attribute | Default | Description |
|---|---|---|
|
| Language for the widget interface. |
| (from config) | Tenant database identifier. Only use if you need to override the default configuration. |
| (from config) | Shop subdomain identifier. Only use if you need to override the default configuration. |
Examples
German language (default):
<kms-search-widget route="https://your-shop.com/rent"></kms-search-widget>
English language:
<kms-search-widget route="https://your-shop.com/rent" language="en-uk"></kms-search-widget>
With tenant override:
<kms-search-widget
route="https://your-shop.com/rent"
rotype="your-tenant-id"
subdomain="your-shop-subdomain"
></kms-search-widget> How It Works
Loading: When the page loads, the widget scripts register a custom HTML element called
<kms-search-widget>.Initialization: Our middleware detects the URL where the script is being loaded from and it loads the corresponding shop and tenant configuration.
Display: The widget renders a search form with:
Station/Location selector
Pickup date
Pickup time
Return time
Submission: When the user clicks search, they are redirected to the URL in the
routeattribute with the search parameters.Styling: The widget automatically applies the styles configured in the backoffice (primary color, rounded corners, etc.).
WordPress Integration
To add the widget to a customer's WordPress site:
Adding scripts to the theme: Add to the theme's
functions.php:function add_kms_widget_scripts() { wp_enqueue_script('kms-widget-polyfills', 'https://search-rent-widget.azurewebsites.net/{version}/browser/polyfills.js', array(), null, true); wp_enqueue_script('kms-widget-main', 'https://search-rent-widget.azurewebsites.net/{version}/browser/main.js', array('kms-widget-polyfills'), null, true); } add_filter('script_loader_tag', function ($tag, $handle, $src) { if ($handle === 'kms-widget-polyfills' || $handle === 'kms-widget-main') { return '<script type="module" src="' . esc_url($src) . '"></script>'; } return $tag; }, 10, 3); add_action('wp_enqueue_scripts', 'add_kms_widget_scripts');
Note: Replace
{version}with the actual version number.
Then use the widget element anywhere:
<kms-search-widget route="https://your-shop.com/rent"></kms-search-widget>
Troubleshooting
Widget not appearing
Check browser console for JavaScript errors
Verify all script files are loading correctly (check Network tab)
Ensure the
routeattribute is provided - it is required
Widget shows error or blank
Verify CORS headers allow requests from the customer's domain
Styling issues
The widget includes its own styles and should display correctly
If you need to adjust sizing, wrap it in a container:
<div style="max-width: 800px; margin: 0 auto;"> <kms-search-widget route="..."></kms-search-widget> </div>
Versions
We recommend that new customers install the latest version.
1.0.0 (04/02/2026)
First release