Hi,
The solution depends of the plugin version you are using (may require to pass an additional parameter to the booking form shortcode or to create a custom script for selecting the service). Some coding may be needed. Please indicate the version number you are currently using.
Thank you for using the plugin!
Hi,
OK, in that version of the plugin you will need a piece of custom script to apply that selection (selecting service based on a URL parameter).
For example, if the service parameter is specified in the URL this way:
/sample-page?service=1
… then the piece of code is like the following:
jQuery(document).one("showHideDepEvent", function(){
(function($) {
location.queryString = {};
location.search.substr(1).split("&").forEach(function (pair) {
if (pair === "") return;
var parts = pair.split("=");
location.queryString[parts[0]] = parts[1] &&
decodeURIComponent(parts[1].replace(/\+/g, " "));
});
if (typeof location.queryString.service != 'undefined')
$(".ahbfield_service option").eq(parseInt(location.queryString.service)-1).prop("selected", true).change();
})(jQuery);
});
You can paste that piece of code into the settings area “Appointment Hour Booking >> General Settings >> Edit Scripts”.
Thank you for using the plugin!
-
This reply was modified 4 years, 7 months ago by
codepeople.