Note: This widget is intended to see available time slots for single items within one day. If you want to display multiple items check out the Disposition Widget for multiple items
Preview
Here is a preview of the widget.
Installation
<div id="rentware-widget--dispo-widget" style="min-height: 400px;"></div>
<script>
var loadRentwareWidgetScriptAsync = function(uri){
return new Promise((resolve, reject) => {
var tag = document.createElement('script');
tag.src = uri;
tag.async = true;
tag.onload = () => {
resolve();
};
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
});
}
var rentwareWidgetScriptLoaded = loadRentwareWidgetScriptAsync('https://rentware-cwidgets-cdn.b-cdn.net/collections/itemDispoWidgetDynamic.js');
</script>
<script>
rentwareWidgetScriptLoaded.then(function(){
ItemDispoWidgetDynamic.init({
elementId: 'rentware-widget--dispo-widget',
bookingUrl: "https://spreeboote.rentware.io",
itemId: "T417LX",
lang: "de", // de-ch, en-gb, en-us, nl, nb
step: "15",
minDuration: "60",
durationStep: "30",
openingHour: "08", // 'HH'
closingHour: "23", // 'HH'
shopNextStep: true,
showPrice: true,
season: {
start: '07-06', //'MM-DD' first day of the season in the current year
end: '09-07', //'MM-DD' last day of the season in the current year
endOfSeasonNotice: 'Unsere Season ist zu Ende. Wir freuen uns aufs nächste Jahr',
},
date: {
dayOffset: '1',
},
strings: {
book: "book for",
currency: "€",
afterPrice: "now",
freeSlots: "Free slots:",
freeSlotsNotAvailable: "In diesem Zeitraum keine Slots verfügbar.",
choose: "HH:MM",
notAvailable: "Not available",
inputLabelFrom: "From",
inputLabelTo: "To",
}
});
});
</script>
Changes with version 1.1
1. You can now display the quantity of the item
<script>
rentwareWidgetScriptLoaded.then(function(){
ItemDispoWidgetDynamic.init({
...
shopNextStep: true,
showPrice: true,
showQuantityInformation: true, // shows how many items are available eg.: >>3 of 6 available<<
showQuantityTotal: true, // shows how many items are available in total eg.: 3 of >>6<< available
showQuantitySelector: true, // user can adjuste the item quantity
...
...
...
strings: {
buy: 'Rent for',
notAvailable: 'Not available',
inputLabelFrom: 'Start',
inputLabelTo: 'End',
currency: ' €',
notAvailableHelp: 'Das Produkt ist zu diesem Zeitpunkt nicht verfügbar. Bitte wählen Sie ein anderes Datum aus.', // leave empty or delete this line if you don't want to show a message when the item is not available
}
});
});
</script>