Okay
  Public Ticket #2071929
Using Amelia Javascript Hooks
Closed

Comments

  • lam started the conversation

    Hi,

    I am intrested in your Amelia Booking Plugin and would like to purchase it. Before making any purchase, I want to get my head around how to use your javascript hooks - eg : 

       window.beforeAddToCalendarLoaded() 
       window.beforeBookingLoaded()
       window.beforeSearchLoaded()
       window.beforeSearchFiltered()
       ....

    Can please provide me an explaination of how and where these hooks are used. Even better sitll, can you also provide me with code samples of their usage.

    I think you have a very good product, just a little short on documentation for developers. With a good developer documentation you can dominate this market.

    Thanks in advance. 

  •  471
    Isidora replied

    Hi lam,

    Thank you for your interest in our plugin.

    Sorry for late response. 

    We are located in Serbia and our working time is from 10:00 to 17:00 CET. business days.

    Unfortunately we don't have hooks (action and filters) at the moment. What we have is a few JS hooks that is triggered depends on the view:

    These are hooks that you can use to follow each step of the booking process. These hooks are ordered by the time of execution. Some of these functions accepts parameters that you can see in the parentheses, so you can send the data.

    • beforeBookingLoaded
    • afterBookingSelectService(appointment, service, provider, location)
    • afterBookingSelectDateAndTime(appointment, service, provider, location)
    • beforeConfirmBookingLoaded(appointment, service, provider, location)
    • afterConfirmBooking(appointment, service, provider, location)
    • beforeAddToCalendarLoaded(calendarData)

    This is the example how you can use one of the hooks on the page where you are using our shortcode:

    <script>
    window.afterConfirmBooking = function(appointment, service, provider, location) { 
       // Add your custom code here
    };
    </script>

    One of the most usage is for Track conversation.

    You can use hooks like beforeConfirmedBooking that will be triggered when your customers confirm booking and it will be redirected on your custom URL which you define (so you can use it on tracks). You can set that redirect URL that you need like on this script (we use https://www.google.com as example, but you will replace this with your own URL)

    <script>
    window.beforeConfirmedBooking = function()
    {
    window.location.href = "https://www.google.com";
    };
    </script>

    Best regards.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables