- changed status to resolved
Backend appointment gCal sync
Use this snippet to sync unpaid appointments.
add_filter( 'woocommerce_appointments_gcal_sync_statuses', 'gcal_sync_unpaid_statuse' );
function gcal_sync_unpaid_statuse( $sync_statuses ) {
//* Sync with unpaid appointments
array_push( $sync_statuses, 'unpaid' );
return $sync_statuses;
}
Add an appointment through the dashboard. The appointment is not synced to gCal. You have to open and save the appointment in order for it to sync with gCal.
Reported here: https://bizzthemes.com/forums/topic/unpaind-sync-does-not-work/
Comments (6)
-
-
Account Deleted Is there a way to override this with some code?
So unpaid appointment created from the backend does sync immediately?
-
@tpmateusz Yes, with the code snippet Valentina added here. Otherwise, would you also like to send confirmation email notification to customer when appointment is added in admin?
-
Account Deleted I have this snippet in my funcions.php, and it behaves the way I reported in the forum and Valentina described here.
I would like to have it sync and send an email when it's created (without having to open and save it).
-
I've now added a new filter in 3.7.0, so you'll be able to achieve what you want with the snippet below:
add_filter( 'woocommerce_appointments_create_appointment_args', 'create_new_admin_appointment_status', 10, 2 ); function create_new_admin_appointment_status( $arguments, $new_appointment_data ) { $arguments['status'] = 'confirmed'; return $arguments; }
-
Account Deleted Great! Thanks! :)
I'm waiting for 3.7.0 then. :)
- Log in to comment
This is on purpose, so appointments created in admin don't automatically send emails to customers that their appointment has been confirmed and they need to pay for it.
Alternatively, when order isn't associated with appointments created in admin, appointment is automatically synced to gCal.