Customize the minutes dropdown

Table of Contents

How Can We Help?

Customize the minutes dropdown

You are here:

Go to “Administration >> Advanced Settings >> Online & Email Settings >> Web Widgets & API”. Create or edit your booking widget and add the following option to the “Add HTML to the HEAD tag” option:

<script>
window.customDurationNames = {
	1440: '1 Day',
	4320: '3 Days'
}
</script>

Under “Add HTML before the BODY tag closure”, add:

<script>
window.svr.htmlOverwrite.duration = function(minutes,selected) {
 window.svr.i18p(function() { if (window.svr.json.stations[window.svr.selection.experience].durations.length > 1) {
  if (selected) {
    $('#title .title button.dur').html((window.customDurationNames[minutes]||(minutes+ ' '+i18next.t('Minutes'))));
  }
  $('#title .title .dur .dropdown-menu').append('<a class="btn btn-block dropdown-item" href="#" onclick="duration.value = '+minutes+';window.svr.Refresh()">'+(window.customDurationNames[minutes]||(minutes+' '+i18next.t('Minutes')))+'</a>');
 }
 else if (selected) {
  $('#title .title').append('<button class="title_button">'+(window.customDurationNames[minutes]||(minutes+' '+i18next.t('Minutes'))) +'</button>').css('padding','0em 0.8em');;
 } }
)}
</script>

Sign Up For Your Trial