Search the site:

Home Blog How to consider holidays in delivery preparation time?

How to consider holidays in delivery preparation time?

Consider holidays in delivery preparation time - Order Delivery Date Pro for WooCommerce

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’,  ‘calculate_minimum_hours_for_holidays’  );
function calculate_minimum_hours_for_holidays()  {
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

4
Leave a Reply

avatar
3 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
Moxa JoganiYoni Recent comment authors

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
newest oldest
Notify of
Yoni
Guest
Yoni

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… Read more »

from purchased

Subscribe Now