Okay
  Public Ticket #3539108
Getting info on the current page where appointment is made
Closed

Comments

  • Dane started the conversation

    Is there a way within one of your hooks such as AmeliaAppointmentBookingAdded we would be able to get the current Wordpress page ID? Or is there a way we could add data so it would be available in the data exposed in that hook?

    The use case for this is to pass the current home being viewed details within the appointment info. 

  •  1,617
    Marko replied


    Hello there,

    Thank you for reaching out to us.

    Amelia currently has the following hooks:

    <script>
    window.ameliaActions = {  ViewContent: function (success = null, error = null, data) {    //triggered when the form loads    console.log('ViewContent HOOK')    console.log(data)    console.log('------------')  },  SelectService: function (success = null, error = null, data) {    //triggered when the service is selected/changed in the form    console.log('SelectService HOOK')    console.log(data)    console.log('------------')  },  SelectEmployee: function (success = null, error = null, data) {   //triggered when the employee is selected/changed in the form    console.log('SelectEmployee HOOK')    console.log(data)    console.log('------------')  },  SelectLocation: function (success = null, error = null, data) {    //triggered when the location is selected/changed in the form    console.log('SelectLocation HOOK')    console.log(data)    console.log('------------')  },  SelectCategory: function (success = null, error = null, data) {    //triggered when the category is selected/changed in the form    console.log('SelectCategory HOOK')    console.log(data)    console.log('------------')  },  SelectPackage: function (success = null, error = null, data) {    //triggered when the package is selected/changed in the form    console.log('SelectPackage HOOK')    console.log(data)    console.log('------------')  },  customValidation: function (success = null, error = null, data) {    console.log('customValidation HOOK')    console.log('------------')    console.log(data)     const customValidator = (rule, value, callback) => {      if (value.includes('SOME_REGEX')) {        callback(new Error())      } else {        callback()      }    }    // this example is for email input field    data.rules.email.push({message: 'CUSTOM MESSAGE', validator: customValidator})  },  InitiateCheckout: function (success = null, error = null, data) {    //triggered once the customer lands on the "info" page where they fill in their details    console.log('InitiateCheckout HOOK')    console.log(data)    console.log('------------')  },  Schedule: function (success = null, error = null, data) {    //triggered once the 'on-site' booking is completed    console.log('Schedule HOOK')    console.log(data)    console.log('------------')  },  Purchase: function (success = null, error = null, data) {    //triggered once an online booking is completed    console.log('Purchased HOOK')    console.log(data)    console.log('------------')  },  beforeBooking: function (success = null, error = null, data) {    //triggered when the "Confirm" button is clicked but before the booking is completed.    //This hook currently doesn't work for Mollie and WooCommerce payments    console.log('Before booking is created HOOK')    console.log(data)    console.log('------------')  },
    }
    </script>

    These are the same hooks used in Google Analytics and Facebook Pixel integrations, but if you need some other hooks added, please let us know which ones and explain what they would contain and when they should be triggered.

    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:

    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)

    JS files are modified (minimized) in public version of plugin (in our development environment is accessible), but unfortunately I can not send you our source code because that is the policy of our company.

    All those files that have extension .vue are compressed and minimized in JS files that is very hard and not recommended modifying. So in order to add some other features you can unminify the js and customize it.

    If you have coding skills ( or if you have your developer),

    you can set up several hooks that will send data from the Amelia plugin to any other application.

     It is good to use this option if you want to send, for example, customer data to some CRM platform.

    You can use any automation tool that allows you to integrate other applications with Amelia, but in our documentation, we have two different methods shown with examples.

    1. Our top recommendation will be to try our integration with Thrive Automator.

    This integration offers you to send data from Amelia to numerous third-party applications after certain actions. Whether you need to add customer details to your CRM, 

    send an additional email after booking or cancelling, update the Google Spreadsheet, etc, the integration with Thrive Automator is made for you. 

    Please check our Documentation page that shows an example of how Thrive Automator is used with Amelia here.

    2. Alternatively, you can also check out the possibility of sending data from Amelia booking with Zapier,

    you can check out How to Connect Amelia WordPress Booking Plugin and Mailchimp with Zapier here.

    So, you can check out both and decide what will be best for your use-case.

    Best regards.

    Kind Regards, 

    Marko Davidovic [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community

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

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables