Hi, we implement Amelia on this (dev) website. Is a password protected, if it could be helpful I'll give you the user password.
I implement two hook, amelia_before_appointment_deleted and amelia_after_appointment_status_updated to change a custom user meta fields. The hook is correctly fired when the event fired but... 1. I need that that event have action only on the client ID that made the appointment reservation. I view that both have the $appointment variable in input, but I don't know how to manage it. 2. For amelia_after_appointment_status_updated I would like that the action will be activated only when the new status is "approved". Is it possible? And... How?
We just got the feedback from our colleagues and they have told us that
1. Since the appointment can have multiple customers when service capacity is over 1, the $appointment object sent in the hook has an array called 'bookings'. You can retrieve the customerId of the first booking like this:
$appointment['bookings'][0]['customerId']
In the hook amelia_after_appointment_status_updated and amelia_before_appointment_deleted the first parameter is the appointment.
2. The second parameter of the hook amelia_after_appointment_status_updated is the requested new status. So check if it's approved before doing the actions
The first point is clear, I've a little doubt on second one: "So check if it's approved before doing the actions ", is it possible to have all the values possible defined by default? Is only the label that I could set on backend or the values are different?
We just got the feedback from our colleagues and they have told us that if you are referring to the labels seen on the page these are not related to how the status is sent to the backend. The only possible values are: 'approved', 'pending', 'rejected', 'canceled' and 'no-show'. They will not be effected by translations and similar things
Also, the amelia_after_appointment_status_updated hook is only triggered when the status is changed on the Appointments page from the dropdown (picture 1). You should also implement amelia_after_appointment_updated hook (https://wpamelia.com/wp-hooks-appointments/#update) which is triggered when the appointment is updated from the dialog (picture 2) and you can check the status of the first parameter as that is the new/changed appointment ($appointment['status']).
I view your reply, but I've still a problem that I hope that you could help to fix.
Now I've the customerId on
$appointment['bookings'][0]['customerId']
but I need to have a correlation between the customerId and the related userid because for the action that I have to do on my hook i need the userid. Is possible to know that?
The order status is now tested and it works perfectly, thank you
We just got the feedback from our colleagues and they have told us that the amelia customer are tied to WordPress users through a column called 'externalId'. However this attribute is not in the $appointment object, but you can do a query on the amelia_users table, find the row with id that matches the customerId, and retrieve the 'externalId'.
Should you have any further inquiries, we kindly request that you open separate tickets for each question and we will gladly help you there.
We wish you all the best and hope you have a wonderful day ahead.
Hi, we implement Amelia on this (dev) website. Is a password protected, if it could be helpful I'll give you the user password.
I implement two hook, amelia_before_appointment_deleted and amelia_after_appointment_status_updated to change a custom user meta fields.
The hook is correctly fired when the event fired but...
1. I need that that event have action only on the client ID that made the appointment reservation. I view that both have the $appointment variable in input, but I don't know how to manage it.
2. For amelia_after_appointment_status_updated I would like that the action will be activated only when the new status is "approved". Is it possible? And... How?
Thanks for your support
Pietro
Hello there,
Thank you for reaching out to us.
We will have to consult our developers and as soon they send us feedback we will reach out to you again on this ticket.
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 again,
We just got the feedback from our colleagues and they have told us that
1. Since the appointment can have multiple customers when service capacity is over 1, the $appointment object sent in the hook has an array called 'bookings'. You can retrieve the customerId of the first booking like this:
In the hook amelia_after_appointment_status_updated and amelia_before_appointment_deleted the first parameter is the appointment.
2. The second parameter of the hook amelia_after_appointment_status_updated is the requested new status. So check if it's approved before doing the actions
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
Hi,
first of all thanks for your reply.
The first point is clear, I've a little doubt on second one: "So check if it's approved before doing the actions ", is it possible to have all the values possible defined by default? Is only the label that I could set on backend or the values are different?
Thanks for your support.
Pietro
Hello again,
I will need to check this with my colleagues and let you know as soon as we have more information.
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 if you are referring to the labels seen on the page these are not related to how the status is sent to the backend. The only possible values are: 'approved', 'pending', 'rejected', 'canceled' and 'no-show'. They will not be effected by translations and similar things
Also, the amelia_after_appointment_status_updated hook is only triggered when the status is changed on the Appointments page from the dropdown (picture 1). You should also implement amelia_after_appointment_updated hook (https://wpamelia.com/wp-hooks-appointments/#update) which is triggered when the appointment is updated from the dialog (picture 2) and you can check the status of the first parameter as that is the new/changed appointment ($appointment['status']).
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 Marko.
I view your reply, but I've still a problem that I hope that you could help to fix.
Now I've the customerId on
but I need to have a correlation between the customerId and the related userid because for the action that I have to do on my hook i need the userid. Is possible to know that?
The order status is now tested and it works perfectly, thank you
Hello again,
We are not sure if everything si fine now or do you still need us to forward this to our dev so that we can get their opinion.
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 again,
We just got the feedback from our colleagues and they have told us that the amelia customer are tied to WordPress users through a column called 'externalId'. However this attribute is not in the $appointment object, but you can do a query on the amelia_users table, find the row with id that matches the customerId, and retrieve the 'externalId'.
Should you have any further inquiries, we kindly request that you open separate tickets for each question and we will gladly help you there.
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