|

Add a trigger to custom element to open a booking form

You can add a trigger to your custom element to open a booking form when the element is clicked by adding the os_trigger_booking css class to that element.

If you want to preselect agent, location or service on the booking form, you will have to add data- attributes to your element. Note: it works with any attribute that is available for a booking button shortcode, just replace underscore with a dash:

data-selected-location="1"
data-selected-agent="2"
data-selected-service="3"
data-selected-duration="60"

Example:

<a href="#" class="os_trigger_booking" data-selected-service="2">Book Haircut</a>

Full list of available attributes can be found here

Or if you are using a page builder plugin like Elementor, you can set it using their editing tool:

CleanShot 2023 04 27 At 00.10.53@2x 1024x443

Setting custom parameters using data attributes in Elementor:

CleanShot 2023 04 27 At 00.28.46@2x 1024x472
Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

On this page