New Day View – and other enhancements

Issue #25 resolved
johannesmutter created an issue

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.

appointments-day-view.png

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)

  1. Željan Topić

    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.

  2. johannesmutter 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.

    Appointments Flow.png

  3. johannesmutter 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).

  4. Željan Topić

    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.

  5. johannesmutter reporter

    ok, just send them to you by Email.

    here are some screenshots of the edit modals for different appointment and customer statuses:

    Bildschirmfoto 2016-05-04 um 16.57.25.png Bildschirmfoto 2016-05-04 um 16.57.30.png Bildschirmfoto 2016-05-04 um 16.57.34.png Bildschirmfoto 2016-05-04 um 16.57.37.png Bildschirmfoto 2016-05-04 um 16.58.22.png

  6. Željan Topić

    Haven't received any email? Otherwise, are these screenshots coded? Tested your pull request and most of it is not working as it should.

  7. johannesmutter 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.

  8. Željan Topić

    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)

  9. johannesmutter reporter

    ok I will create a new pull request. Can you send me please a screenshot how it looks in your browser?

  10. Željan Topić

    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.

  11. Željan Topić

    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.

  12. Željan Topić

    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.

  13. johannesmutter 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;
        }
    
    }
    
  14. Željan Topić

    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.

  15. Log in to comment