New Day View – and other enhancements
Hi Željan,
I have worked the last weeks on some enhancements and new features I would like to share with you :)
Calendar Day View
- Sort Appointments by staff in columns
- Highlight current user
- Display Availability of staff on calendar. Works currently only for time range (Monday, Tuesday, Wednesday, etc.).
- Show current time on current day
- Added new field: "customer status". Staff can select, wether a customer arrived or not (no-show) or if he’s "waiting". Default is "expected". The Appointment is styled depending on the status (customer + appointment status).
- Added Support for WooCommerce Point of Sale and WooCommerce Customer Relationship Manager (both by actualityextensions.com).
- Style: Fixed Header on day view.
For the “Edit Appointment Modal” I need some help with the Ajax function to update the appointment (e.g. cancel it/ change status, etc.). I already created the php function, but the Ajax function needs to be developed properly.
Add Appointment
- Added a hook, so users can set to always create a corresponding order for the appointment:
if ( class_exists( 'WC_Appointments' ) ) {
// Always create a corresponding order for new appointments
function appointments_always_create_order() {
$always_create_order = true;
return $always_create_order;
}
add_filter( 'woocommerce_appointments_always_create_order', 'appointments_always_create_order' );
}
WooCommerce Product Category
- Added new field: Product Category Color (in WooCommerce Categories). Will be used to display the appointments in the calendar with a specific colour.
I tried to create a pull request, but it says “access denied”.
If you like we can sykpe and discuss how to implement these features.
Btw. my client really loves your plugin.
Comments (18)
-
-
reporter I made a small graphic to visualize the appointment flow (including the new “customer status"). This should help defining the allowed user interactions with an appointment for different appointment & customer conditions.
-
Make a pull request and I'll review how this looks in practice.
-
reporter ok I just created the pull request.
Most of the changes affect the calendar day view, especially class-wc-appointments-admin-calendar.php and html-calendar-day.php
Here all the necessary ajax functions have to be created for all the buttons.
Currently one needs to manually assign each staff to a column --> “Display Order” (in user profile settings, after availability).
-
I'll look into this. Are there any functions/features that require external plugin to work?
-
reporter The Raise Sale Button requires the “WooCommerce-Point-of-Sale" Plugin.
I also added support for the WooCommerce Customer Relationship Manager.
But these buttons will only display if the plugins are installed and activated.
Shall I send you the plugins?
-
Sure, send them through. I'll need to create some kind of filters for this and add those external integrations under integrations folder, where other integrations are stored.
-
reporter ok, just send them to you by Email.
here are some screenshots of the edit modals for different appointment and customer statuses:
-
Haven't received any email? Otherwise, are these screenshots coded? Tested your pull request and most of it is not working as it should.
-
reporter I’ve just send you the download links. The screenshots show coded content. But currently only the “EDIT” Button works. All the other buttons require an ajax function. But I don’t know yet, how do develop this.
-
Received.
You can leave ajax to me, I need the design to work before this - send the updated files for that if you have them.
Also, these won't make it in core: * staff column order (will be covered with filter) * category metabox for color (will stay the same as-is)
-
reporter ok I will create a new pull request. Can you send me please a screenshot how it looks in your browser?
-
Updated files available here on Bitbucket.
Also, staff members in tabs won't work, shoukd be added as a filter next to product filter. This fixes loads of overhead styling that would be required for tabbed view.
-
I've now committed 1.8.6 that includes most of improvements, except modal, which needs to be refined before being accepted to core. I appreciate your suggestions and am looking forward to modal refinements. Please contribute smaller chunks as pull requests, otherwise it's hard to overview them.
-
With today's 1.8.8 update, most of suggested improvements have been implemented. Ajax status update from admin calendar is the only thing left for future update.
-
- changed status to resolved
-
reporter I made some commits:
-
The Staff columns view is now available by filter.
-
Added Support for these plugins: WooCommerce Customer Relationship Manager + Point of Sale. I wasn’t sure whether to write the code in e.g. html-calendar-dialog.php or to create a new class in integrations. I think the latter makes more sense. But currently they are “inline”.
-
I added a filter to change the height of the calendar e.g. instead of 60px per hour, one can set it to 100px or 200px per hour.
So these are all the filters I have added now:
if ( class_exists( 'WC_Appointments' ) ) { // Default Calendar view: 'day' or 'month' add_filter( 'woocommerce_appointments_calendar_view', 'appointments_default_view' ); function appointments_default_view() { $default_view = 'day'; return $default_view; } // Set day view to sort appointments by staff in columns — default: false add_filter( 'woocommerce_appointments_calendar_view_by_staff', '__return_true' ); // Show product in appointment item — default: false add_filter( 'woocommerce_appointments_calendar_view_show_product', '__return_true' ); // Always create a corresponding order for an appointment — default: false add_filter( 'woocommerce_appointments_always_create_order', '__return_true' ); // Change the scale of the calendar items in day view — default: 60 add_filter( 'woocommerce_appointments_calendar_view_day_scale', 'appointments_day_scale' ); function appointments_day_scale(){ return 100; } }
-
-
I've included most improvements, but have removed all external plugin dependent code from core. Add this to /integrations/ folder if needed.
Dialog box for adding appointments is also not coded correctly and needs improvements before going live.
- Log in to comment
Looks really great. Send the modified files to info@bizzthemes.com. Otherwise, I've now granted you a write access, so you should be able to create pull requests.