top of page
Custom Book flow on Booking V2

Custom Book flow on Booking V2

Let Customers Experience your swift and customized appointment booking process with Bookings V2 APIs.

Intermediate.png

Intermediate

6K

Published:

November 22, 2023

Girl Enjoying her Drink

by

Anchor 1
Hire a Developer

Example Description

Custom Elements allow you to embed a Web Component in a page. In this example, we demonstrate sending information from the page to the Custom Element and from the Custom Element to the page.


Note that custom elements only work fully on premium sites with a connected domain.

Example Code

.

.

This code solution can be complicated.

How We Built It

Page Elements


We split the HOME page into 2 sections.


The top section contains regular Wix elements. It has 2 text elements: one is used as a label and the other is used to display information passed to the page from the Custom Element. This section also contains a button used to send a message to the Custom Element.


The bottom section contains a Custom Element. Inside the element we use CSS, and JavaScript to create 2 text elements and a button. One text element is used as a label and the other is used to display information passed to the Custom Element from the page. The button used is used to send a message to the page.


Page Code


We added 2 event handlers to the HOME page.


The first event handler runs when the button to send messages from the page to the Custom Element is clicked. It uses the Wix `setAttribute()` function to send the message.


The second event handler runs when a message is received from the Custom Element. It populates the received message into the text element with the ID `message`.


Custom Element Code


The Custom Element's code can be found in the Public section of the Velo Sidebar.


The code begins with some functions that create HTML elements that will be added to the Custom Element.


Next there is a function that creates the styles for the HTML elements.


Finally, there is a class that defines the Custom Element itself. Inside the class, there is code for adding HTML elements to the Custom Element, including code for sending a message to the page when the button is clicked. There is also code for handling messages sent from the page.

APIs We Used

Non-code example.

Related Articles

Article Link

Hire a Developer

Velo solutions are powerful tools, but building them on your own can be challenging. Let an experienced Velo development shop build it for you, so you can keep working on your site or business.

Related Examples

Did this help?

Yes

|

No

Thanks for your feedback!

Service Page

Service Page

Create a custom service page with related products for sale.

Intermediate.png

Intermediate

Limit the number of bookings per contact in a week with ECOM Validations SPI

Limit the number of bookings per contact in a week with ECOM Validations SPI

Limit each site member’s bookings to no more than three per week.

Intermediate.png

Intermediate

Service List

Service List

Filter a list of services and view the next available slot.

Intermediate.png

Intermediate

Round Robin appointment scheduling

Round Robin appointment scheduling

Allow bookings with no staff selection, creating Round Robin scheduling - evenly spread the bookings among staff members

Intermediate.png

Advanced

Replace Bookings Calendar page

Replace Bookings Calendar page

Replace the default Wix Booking Calendar on your site with a tailored version to better suit your needs.

Intermediate.png

Intermediate

Anchor 2

This website was designed with Velo by Wix

bottom of page

We use cookies and similar technologies. You can opt-out by clicking 'Do Not Sell or Share My Personal Information' at the bottom of the page.