Delivery Time (New Module)

We are badly hit by super cyclone Amphan. Our response will get delayed!

This topic contains 13 replies, has 6 voices, and was last updated by Avatar Craig 3 weeks, 2 days ago.

  • Author
    Posts
  • #125163
    WCFM Forum
    WCFM Forum
    Keymaster

    We have added “Delivery Time” module in latest WCFM – Delivery addon update.

    Check details here.

    WCFM – Delivery is essential for this module to work.

    Thank You

  • #125237
    Avatar
    Craig
    Participant

    WOW this is an awesome enhancement!!! Thanks for doing this!

  • #125447

    but i didnt understand how it work

  • #125459
    Avatar
    Djordje Jevtic
    Participant

    Is it possible that Vendor changes times per store and not only superadmin ?

  • #125462
    Avatar
    Craig
    Participant

    according to the instructions “Vendors are allow to define their preferred delivery time slots from their Setting panel – Delivery Times”

  • #126300
    Avatar
    Craig
    Participant

    I noticed in my admin setting panel that the “delivery time” module is not showing it’s icon in the modules section.

    Attachments:
    You must be logged in to view attached files.
  • #126305
    Avatar
    Craig
    Participant

    Is it possible to add a schedule to when the “delivery time slots” are available similar to the way they set opening times for their store?

    This way the vendor can limit the times that delivery is available so the customer can’t select delivery times that are not available.

    For example if a vendor can only offer delivery between 8:00am and 6:00pm on weekdays.

    Attachments:
    You must be logged in to view attached files.
  • #126441
    Avatar
    Djordje Jevtic
    Participant

    That would be nice option. Most of the vendors can deliver only in some time frames and some days…
    Check plugin https://woocommerce.com/products/woocommerce-order-delivery/ so that forntend have view like this: https://woocommerce.com/wp-content/uploads/2015/09/wc-od-checkout-delivery-date.png

  • #126967
    Avatar
    Miguel Angel Calle
    Participant

    Hi,

    I think include this module is a great idea!
    I have been checking it and for me I can’t see the section “Daily Basis Delivery Time Slots” and “Set week day OFF”.
    Could you help me to find why I am not able?

    Thanks.

  • #127427

    Ok, couple of amends that we’ve made to the code to get it a little more suitable for what we need.

    When you select only delivery date to show you end up getting a time being displayed on the screen on the orders and order summary.

    We amended as follows: (if delivery display format set to date then set current_time to midnight and work from there)

    All in wp-content/plugins/wc-frontend-manager-delivery/core/class-wcfmd-delivery-time.php

    In generate_vendor_delivery_time_checkout_field (around line 389)

    if ($wcfm_delivery_time_display_format == 'date'){
         //reset to midnight of today
         $current_time = strtotime('today midnight');
     }
    else {
         $current_time = current_time( 'timestamp' );
    }

    Then to make the time selection slightly nicer make them start on say 15 min blocks. Rather than 7:42am as an option have 7:45am instead..

    Inbetween where $start_time and $end_time are first set in generate_vendor_delivery_time_checkout_field:

                //lets start at a more reasonable time.. i.e. in the next 15 min block
                $datetime = new DateTime;
                $datetime->setTimestamp($start_time);
                $second = $datetime->format("s");
                if($second > 0)
                    $datetime->add(new DateInterval("PT".(60-$second)."S"));
                $minute = $datetime->format("i");
                $minute = $minute % 15;
                if($minute != 0)
                {
                    // Count difference
                    $diff = 15 - $minute;
                    // Add difference
                    $datetime->add(new DateInterval("PT".$diff."M"));
                    $start_time = $datetime->getTimestamp();
                }

    finally change the section that sets $is_valid_time = true to be greater than or equal to etc.. rather than just greater than and less than:
    Note its $next_time_slot >= $open_hours and $next_time_slot <= $close_hours that have just had the equals (=) sign adding in.. makes it work better for me.. especially if it’s delivery days that vendors are using (needs open time to be 00:00 and close time to be 23:59 in delivery times)

    if( ( $next_time_slot >= $open_hours ) && ( $next_time_slot <= $close_hours ) )  {
       $is_valid_time = true;
       break;
    }

    in wcfmd_customer_order_delivery_time_show, wcfmd_order_list_delivery_time_show, wcfmd_order_details_delivery_time_show
    If date is midnight (i.e. it’s just display date) setting then don’t display time part..

    within the for each loop: (check if date time is midnight and if so then only show date)

    $datetime = new DateTime;
    $datetime->setTimestamp($wcfmd_delvery_time);
    
    if( date_format($datetime,'H') == 0 && date_format($datetime,'i') == 0) {
         echo date_i18n( wc_date_format(), $wcfmd_delvery_time );
    }
    else {
         echo date_i18n( wc_date_format() . ' ' . wc_time_format(), $wcfmd_delvery_time );
    }

    Bit of a brain dump but hope it makes sense! (have also attached file)

  • #127514
    Avatar
    Djordje Jevtic
    Participant

    Hi,
    This seems nice.
    Is it possible to add in in templates folder so next update not override it ?
    If yes please write which folder to create.
    Thanks

  • #127633
    Avatar
    Craig
    Participant

    @miguel Angel Calle

    I don’t think those sections exist in the delivery time section (for vendors) which is why you can’t see those “Daily Basis Delivery Time Slots” and “Set week day OFF”.

    BUT those sections do show up under the Store Hours section (for vendors)

    Attachments:
    You must be logged in to view attached files.
    • #127980
      Avatar
      Miguel Angel Calle
      Participant

      Hi @Craig,

      If you check in the module documentation, you can see there is a section for Daily available time slots. That looks independent to the Store hours opening.
      I attach you what I am missing.

      Thanks.

      Attachments:
      You must be logged in to view attached files.
  • #128190
    Avatar
    Craig
    Participant

    @miguel Angel Calle I see that now. It looks like this was an enhancement to the plugin in the last day or two. I just updated the plugin this morning and the revision notes mention this enhancement.
    Do you have the most current WCMF plugin versions?

    Changelog
    3.3.11
    *Updated – 08/05/2020

    Enhance – WooCommerce 4.1 compatibility added
    Enhance – Local Pickup shipping option vendor’s address append with shipping label
    Enhance – Delivery Time “Week Day Off” and “Daily basis time slots” compatibility added

    https://wordpress.org/plugins/wc-multivendor-marketplace/#developers

You must be logged in to reply to this topic.