As previously announced via banners and our newsletters, support is no longer available through this platform.

For easier navigation, you can still click on "Submit a Ticket" here, choose the appropriate category, and you'll be redirected to the correct support channel for your plugin.

You can still access your previous tickets and browse public tickets, but please note that responding to tickets is no longer possible.

Paid customers: Please log in to your store account for support.

Pre-purchase questions: Use the support widget in the bottom-right corner of our websites:
https://wpamelia.com
https://wpdatatables.com
https://wpreportbuilder.com

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?