For restaurants and food delivery businesses, adjusting delivery and pickup times based on the day of the week is crucial for efficient order management. Some days may have higher order volumes, requiring longer preparation times, while others may allow for faster deliveries.
With WooFood – the ultimate WooCommerce food ordering plugin, you can easily modify delivery times dynamically using a custom PHP snippet.
In this guide, we’ll show you how to automatically adjust WooCommerce delivery times based on the current day.
Why Adjust Delivery Time Dynamically?
✔ Improves restaurant efficiency – Helps businesses manage peak-hour rush efficiently.
✔ Enhances customer satisfaction – Provides more accurate delivery estimates.
✔ Automates delivery settings – No need for manual adjustments each day.
✔ Seamless integration with WooCommerce – Works smoothly with the WooFood plugin.
How to Change WooCommerce Delivery Time Based on the Day Name
To dynamically adjust pickup and delivery times, insert the following PHP snippet into your child theme’s functions.php
file:
add_filter( 'woofood_adjust_delivery_time_thankyou', 'wpslash_custom_hook_dynamically_change_pickup_time', 10, 2 );
add_filter( 'woofood_adjust_pickup_time_thankyou', 'wpslash_custom_hook_dynamically_change_pickup_time', 10, 2 );
function wpslash_custom_hook_dynamically_change_pickup_time( $time, $order_id ) {
$current_day_name= current_time("l");
if($current_day_name == "Monday")
{
return "45";
}
if($current_day_name == "Tuesday")
{
return "30";
}
if($current_day_name == "Wednesday")
{
return "60";
}
return $time;
}
How This Code Works
✅ Uses current_time("l")
to detect the current day of the week.
✅ Modifies the delivery and pickup time dynamically.
✅ Applies the adjusted time at checkout and order confirmation.
✅ Works seamlessly with WooCommerce food ordering systems.
Best Practices for Implementing Dynamic Delivery Times
🔹 Customize time values to match your restaurant’s workflow.
🔹 Add more conditions if you want different times for additional days.
🔹 Test the function in a staging environment before applying it to your live store.
Enhance Your WooCommerce Food Ordering System with WooFood
Managing food delivery and pickup schedules effectively is essential for smooth restaurant operations. Instead of manually adjusting delivery hours, you can automate everything with a fully-featured WooCommerce restaurant plugin like WooFood.
Why Choose WooFood?
✅ Customizable delivery schedules – Set different pickup and delivery times for each day.
✅ Flexible restaurant ordering system – Works for takeaway, delivery, and dine-in.
✅ Live order tracking & notifications – Improve customer experience with real-time updates.
✅ Automatic order printing – Send orders directly to the kitchen without delays.
🚀 Optimize Your WooCommerce Food Delivery System Today!
👉 Discover WooFood – The Best WooCommerce Food Ordering Plugin and take your restaurant business to the next level!