I'm trying to add some webhooks to our theme to have Amelia report bookings and appointments data, but I can't for the life of me work out your developer documentation, if you can call it that. Is there any more specific and detailed documentation anywhere? I need something that outlines what parameters can be passed to each hook, what structure these parameters have, what actions can be performed on them. Something a bit more than // do action!
Unfortunately, no we do not yet have developer documentation just regular documentation and each hook that we have you have there. We can ask our developers for their opinion so that they can point you in the right direction but we would need more details than that. Please elaborate more or send example what you want to achieve exactly and we will forward this to our developers so that they can offer their opinions.
This works fine, more or less, with backend appointments. But I need to do exactly the same thing from frontend appointments made though the [ameliasearch] drop in. I haven't found the correct trigger that will give me an identically structured $appointment array as the one shown above.
I've tried the 'amelia_after_booking_added' hook, which doesn't seem to work at all and the 'amelia_after_appointment_booking_saved' hook, which gives me inconsistent data.
We are not sure if this can be achieved or not we can ask our developers for their opinion and as soon as they send us feedback we will reach out to you again on this ticket.
We just got the feedback from our colleagues and they have told us that the 'amelia_after_booking_added' hook is fired after the booking is added from the search form. This is the structure of the parameter sent.
To get the same data you will need to put $appointment['appointment'].
Yeah, nothing was received. In fact, the only message I received was when I created an appointment for myself in the backend. Is there any error logging done by the plug-in?
The issue I'm having is that the amelia_after_booking_added hook isn't being triggered. I've had a function that should be actioned by that hook going since the last response from Marko and I haven't received anything from it. I'm also using wp_mail() since I don't need to instantiate anything special with that. I appreciate the trouble you're going with with the function, but that's not the issue I'm having. It's the hook that seems to be the issue. I'm trying the amelia_after_appointment_booking_saved hook, and it sort of works but I'm getting hundreds of sends, but most of them don't contain any data at all.
When I turn on debugging I'm getting a lot of the following:
PHP Notice Undefined index: isCart in /nas/content/live/theboneclinic/wp-content/plugins/ameliabooking/src/Application/Commands/PaymentGateway/WooCommercePaymentCommandHandler.php on line 64
which is
$data['isCart'] = !!$data['isCart'];
You're not even checking it exists before double negating it.
It seems the hook does not fire when using WooCommerce, we have tested initially with on-site. We will fix this in the next update. For now you can add
I'm not sure if this is related, but we're getting a lot of possible failed recurring appointments. Only the first booked appointment is showing ; none of the subsequent appointments show. I get the feeling that it relates to the code you've posted here.
Also, are you saying that code goes inside the createBookings method of the WooCommerceService object?
This error is nothing to worry about, even though it's annoying:
Cannot read properties of null (reading 'replaceChild')
It is something our developers plan to fix, but the point is that it doesn't break anything in the plugin and it continues to work normally even with this error displayed.
There's only one line like this in this file, and you need to add the code I mentioned below the entire line I sent:
If this is where you added it, it should be OK. Just make sure to purge the cache on your website.
If you believe this addition causes the issue with recurring appointments, try removing it (reverting the file to the original state) and test again (after purging the cache, of course).
If you can't replicate the issue with recurring appointments once the added code is removed, I'll ask our developers to revisit the case.
I'm trying to add some webhooks to our theme to have Amelia report bookings and appointments data, but I can't for the life of me work out your developer documentation, if you can call it that. Is there any more specific and detailed documentation anywhere? I need something that outlines what parameters can be passed to each hook, what structure these parameters have, what actions can be performed on them. Something a bit more than // do action!
Hello there,
Thank you for reaching out to us.
Unfortunately, no we do not yet have developer documentation just regular documentation and each hook that we have you have there. We can ask our developers for their opinion so that they can point you in the right direction but we would need more details than that. Please elaborate more or send example what you want to achieve exactly and we will forward this to our developers so that they can offer their opinions.
Looking forward to your reply.
Kind Regards,
Marko Davidovic
[email protected]
Rate my support
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
Hello,
At the moment I have the following code (some obfuscation):
add_action('amelia_after_appointment_added', 'ccccc_amelia_appointments_exec', 10, 1);
function ccccc_amelia_appointments_exec ($appointment) {
wp_remote_request( 'https://api.example.com/index.php/appointment/create', array(
'method' => 'GET',
'body' => array( "start" => $appointment['bookingStart'] ,
"client_id" => $appointment['bookings'][0]['customer']['id'] ,
"fname" => $appointment['bookings'][0]['customer']['firstName'] ,
"sname" => $appointment['bookings'][0]['customer']['lastName'] ,
"amelialink' => $appointment['id'],
"ameliaserviceid" => $appointment['serviceId']),
) );
}
This works fine, more or less, with backend appointments. But I need to do exactly the same thing from frontend appointments made though the [ameliasearch] drop in. I haven't found the correct trigger that will give me an identically structured $appointment array as the one shown above.
I've tried the 'amelia_after_booking_added' hook, which doesn't seem to work at all and the 'amelia_after_appointment_booking_saved' hook, which gives me inconsistent data.
Hello again,
We are not sure if this can be achieved or not we can ask our developers for their opinion and as soon as they send us feedback we will reach out to you again on this ticket.
Kind Regards,
Marko Davidovic
[email protected]
Rate my support
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
Hello again,
We just got the feedback from our colleagues and they have told us that the 'amelia_after_booking_added' hook is fired after the booking is added from the search form. This is the structure of the parameter sent.
To get the same data you will need to put $appointment['appointment'].
We are working on improving our documentation.
We wish you all the best and hope you have a wonderful day ahead.
Kind Regards,
Marko Davidovic
[email protected]
Rate my support
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
Strange that I didn't get a notification for this last response.
OK I'll try it but, as I mentioned, that hook didn't seem to work for me.
Hello again,
Please try again and let us know how it goes.
We wish you all the best and hope you have a wonderful day ahead.
Kind Regards,
Marko Davidovic
[email protected]
Rate my support
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
Hello,
Yeah, nothing was received. In fact, the only message I received was when I created an appointment for myself in the backend. Is there any error logging done by the plug-in?
Hello again,
I will forward this to my colleagues again. As soon as they send us feedback we will reach out to you again on this ticket.
Kind Regards,
Marko Davidovic
[email protected]
Rate my support
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
Hello there.
Marko is out of the office, so I'll jump in.
We have tested the webhook using our mailing services with this code example:
And have received an email when booking from the search form (this hook is tied to all the forms)
You can turn debug on in the wp-config.php file:
and see if any error logs are made in wp-content/debug.log
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
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
Hello,
The issue I'm having is that the amelia_after_booking_added hook isn't being triggered. I've had a function that should be actioned by that hook going since the last response from Marko and I haven't received anything from it. I'm also using wp_mail() since I don't need to instantiate anything special with that. I appreciate the trouble you're going with with the function, but that's not the issue I'm having. It's the hook that seems to be the issue. I'm trying the amelia_after_appointment_booking_saved hook, and it sort of works but I'm getting hundreds of sends, but most of them don't contain any data at all.
What I'd also like to know is, if I had the appointment id can I call a method to give me the appointment data?
When I turn on debugging I'm getting a lot of the following:
PHP Notice Undefined index: isCart in /nas/content/live/theboneclinic/wp-content/plugins/ameliabooking/src/Application/Commands/PaymentGateway/WooCommercePaymentCommandHandler.php on line 64
which is
You're not even checking it exists before double negating it.
Hello again.
It seems the hook does not fire when using WooCommerce, we have tested initially with on-site. We will fix this in the next update. For now you can add
in WooCommerceService.php under these lines
For getting an appointment by its id:
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
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
Where is WooCommerceService.php?
I apologize for that oversight.
It's in \wp-content\plugins\ameliabooking\src\Infrastructure\WP\Integrations\WooCommerce\ folder.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
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
Excellent! And whereabouts does that code snippet go?
Hello again.
This code:
Goes below this:
So around line 2966:
The last piece of code is not our code:
It was sent because you asked how you can fetch an appointment using the ID.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
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
I'm not sure if this is related, but we're getting a lot of possible failed recurring appointments. Only the first booked appointment is showing ; none of the subsequent appointments show. I get the feeling that it relates to the code you've posted here.
Also, are you saying that code goes inside the createBookings method of the WooCommerceService object?
since adding those lines of code I've received 812 of this JavaScript error
Uncaught TypeError: Cannot read properties of null (reading 'replaceChild')
https://theboneclinic.com.au/wp-content/plugins/ameliabooking/public/js/chunks/amelia-booking-appointments-a2b1e1109a618c14b841.js line 1
Hi again.
This error is nothing to worry about, even though it's annoying:
Cannot read properties of null (reading 'replaceChild')
It is something our developers plan to fix, but the point is that it doesn't break anything in the plugin and it continues to work normally even with this error displayed.
The code I sent needs to be added in this file:
\wp-content\plugins\ameliabooking\src\Infrastructure\WP\Integrations\WooCommerce\WooCommerceService.php
So, once you access this file, just search for the first line:
There's only one line like this in this file, and you need to add the code I mentioned below the entire line I sent:
If this is where you added it, it should be OK. Just make sure to purge the cache on your website.
If you believe this addition causes the issue with recurring appointments, try removing it (reverting the file to the original state) and test again (after purging the cache, of course).
If you can't replicate the issue with recurring appointments once the added code is removed, I'll ask our developers to revisit the case.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
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