Okay
  Public Ticket #2556422
hooks
Closed

Comments

  • Matteo started the conversation

    Hi,

    In plugin backend there are Web Hooks as I can see, but I need a php hook, to insert in the functions.php when an appointment prenotation is completed, to update my custom DB table.

    Could you providide to me the hook? I can't find anything on internet.

    Thank you

  • [deleted] replied

    Hi Matteo,

    Thank you for your question.

    Unfortunately, there isn't such option in Amelia with its current built-in features and there are no hooks for actions or filters for that matter in Amelia. There are a few JS hooks which are triggered depending on the view:

    window.beforeAddToCalendarLoaded()
    window.beforeBookingLoaded()
    window.beforeSearchLoaded()
    window.beforeSearchFiltered()
    window.afterSearchFiltered()
    window.beforeConfirmedBooking()
    window.beforeCatalogLoaded()
    window.afterSelectCatalogCategory(object_category)
    window.beforeCatalogCategoryLoaded(object_category)
    window.beforeCatalogServiceLoaded(object_category, object_service)
    window.afterSearchActivateService(object_appointment, object_serviceActive)
    window.afterSearchGoToSecondStep(object_appointment, object_serviceActive)
    window.afterBookingSelectDateAndTime(object_appointment, object_serviceId, object_providerId, object_locationId)
    window.afterBookingSelectService(object_appointment, object_serviceId, object_providerId, object_locationId)
    window.beforeConfirmBookingLoaded(object_appointment, object_service, object_provider, object_location)
    window.afterConfirmBooking(object_appointment, object_service, object_provider, object_location)


  • Matteo replied

    Thank you, that can help me.

    When i'm calling this function

    window.afterBookingSelectService(object_appointment, object_serviceId, object_providerId, object_locationId)
    

    can I set the value of "FirstName", "LastName" and a Custom Field in JS? if Yes could you provide me an example?

    I saw those functions (attachment file) in the browser console.

    Thank you

  • [deleted] replied

    Hi Matteo,

    You can try with something like this:

    <script>
    window.afterBookingSelectService = function () {    jQuery('.el-input input').attr('text/javascript', "Whatever you want")
    }
    </script>
    


    You can also check out this thread (for example), to see how you can populate form fields using jQuery.


  • Matteo replied

    Hi!!!

    I would like to ask if is it possible, via a function in functions.php detect when an appointment is moved or removed from backend?

    Thank you

  • [deleted] replied

    Hello Matteo,

    Can you please elaborate a bit more, what is the use-case?