Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to consider holidays in delivery preparation time?

Some businesses like online landscape supplies, food catering shops where they do not do delivery on certain days like holidays. But they do want to include those holidays in delivery preparation time as they are still open on those days for regular work, but just not delivering.

Such clients face an issue from the Order Delivery Date Pro for WooCommerce plugin where the holidays on which they do not deliver the products are excluded from the delivery preparation time set using the “Minimum Delivery Time(in hours)” option.

So for example, if a user visits the website on a holiday say 19th May and the Minimum Delivery time(in hours) is set to 24 hours. In such cases, the first available day for the delivery will be 21st May and not 20th May. That happens as the Minimum Delivery Time gets counted from the first enabled day, which is 20th May and not 19th May.

Minimum Delivery Time (in_Hours)
Minimum Delivery Time (in Hours)
Holiday Set
Holiday Set
Problem when holidays are not considered
Problem when holidays are not considered

Similarly, for clients having businesses where they do take orders on holidays, but they do not deliver on those days, hence they set them as holidays for the calendar. If such businesses still want to deliver the order on the first available day when there is a holiday between the current date and the selected delivery date, for them the holiday dates should be considered in the delivery preparation time.

This issue can now be overcome by using a hook orddd_to_calculate_minimum_hours_for_holidays from the plugin. This hook allows considering holidays in the delivery preparation time which is set using the Minimum Delivery Time (in hours) option.

Adding the below part of code in functions.php file of the active theme or any other file as per your needs will start considering the holidays in delivery preparation time:

add_filter('orddd_to_calculate_minimum_hours_for_holidays', 'orddd_calculate_minimum_hours_for_holidays');
function orddd_calculate_minimum_hours_for_holidays( $to_calculate ) {
       return 'yes';
}
Calendar after using the hook
Calendar after using the hook

Thus, by using the above hook, we have only considered 19th May as unavailable for delivery, but it’s still a working day for your back office & hence the first available date for delivery is taken as 20th May instead of 21st May.

There are many more hooks and filters available for the Order Delivery Date Pro for WooCommerce plugin that allow you to customize the plugin.

If you can’t find a hook or filter you are looking for, please suggest us & we will be happy to add those.

Browse more in: Documentation, How Tos, Order Delivery Date, WooCommerce

Share It:

4 thoughts on “How to consider holidays in delivery preparation time?

  1. Hi Yoni,

    I can understand that the current plugin does meet your requirements.

    However, we have planned to add a feature of ‘Shipping Days’ options from the plugin which will allow admin to enable shipping/working days. And once the option is enabled the Minimum Delivery time (in hours), Same Day and Next Day delivery features will work on the shipping days selected and not the Delivery Days which are enabled under Date Settings link.

    For example, your shipping/working days are for all the weekdays from Monday and Sunday but your Delivery days are only from Monday to Friday. Then you can set them differently from the plugin.

  2. Hi,

    Currently, the holidays or the disabled weekdays are not counted in the Minimum Delivery Time(in hours) setting. It works only on the working days. So, for example, if the Minimum Delivery Time is set to 48 hours and the enabled weekdays for delivery is Monday to Friday, then if someone comes on Friday the first available day on the calendar will be Tuesday and not Monday.

    The 48 hours is counted only on the working weekdays .i.e Friday and Monday.

    This is the default behaviour of the plugin and this hook is to overcome this behaviour for the customers where they do not deliver on certain days but they do work on that days.

    I hope this answers your query.

    1. Hi, I missed your response when you posted it. But it looks to me like the answer is no, there’s not a straightforward way to do this. I imagine it’s gotta be possible somehow by enqueuing some JavaScript, though I’m relatively inexperienced at frontend WordPress development. I guess it might be doable through adding some settings tabs too, but I’ll have to eventually look at your code to see how easily I can pull it off.

      I suppose I should call this a feature request, then. It seems to me that if you’re already making a partial distinction between the production and delivery schedules, you may want tomake them completely independent in future releases! I could say something like: “My production team only works weekdays, but my location is available for pickup 7 days a week, and but both schedules have some holidays in common”, with a good way to reflect that in my settings.

      Anyway, there’s a decent chance I’ll buy your plugin to experiment with it! Our order volumes are low enough that on the occasion we get one with insufficient lead time, we can deal with it manually. Thanks for your responses!

  3. What if I have the opposite issue? In my foodservice business, people can place special orders for pickup. Our business is open 7 days a week, but our production staff is only in on weekdays. So if something takes 48 hours and a customer orders on Wednesday night, they can choose Sunday pickup. But if they order on Friday morning they can’t, because our production staff doesn’t have the time. Do any of your hooks allow me to adjust availability based on production holidays instead of delivery holidays? (I am the business owner but also capable of doing some of my own coding.)

Leave a Reply

Your email address will not be published. Required fields are marked *

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible.

Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

By using our site, you acknowledge that you have read and understood our Privacy Policy and Terms & Conditions.