WPSlash

How to Dynamically Change Delivery Time Based on the Day in WooCommerce

Thursday May 27, 2021

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!

Leave a Comment

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

Related Articles

Tutorials

How to Set Up SMS and WhatsApp Order Notifications for Your WooCommerce Restaurant (2026)

Why SMS and WhatsApp Notifications Matter for Restaurant Orders A customer places an order on your <a href="https://www.wpslash.com/how-to-set-up-real-time-order-tracking-for-your-woocommerce-restaurant-website-2025-2/" title="How to Set Up Real-Time Order Tracking for Your <a href="https://www.wpslash.com/how-to-set-up-catering-and-large-group-orders-on-your-woocommerce-restaurant-website-2025/" title="How to Set Up Catering and Large Group Orders on Your WooCommerce Restaurant Website (2025)”>WooCommerce Restaurant Website (2025)”>restaurant website at 7:15 PM during the Friday rush. […]
May 3, 2026
Tutorials

How to Set Up Real-Time Order Tracking for Your WooCommerce Restaurant Website (2026)

Why Real-Time Order Tracking Matters for Restaurant Websites Picture this: a hungry customer places an order on your <a href="https://www.wpslash.com/how-to-build-a-customer-loyalty-program-for-your-wordpress-restaurant-website-2025/" title="How to Build a Customer Loyalty Program for Your <a href="https://www.wpslash.com/how-to-connect-your-wordpress-restaurant-website-to-doordash-uber-eats-grubhub-2025/" title="How to Connect Your WordPress <a href="https://www.wpslash.com/how-to-rank-your-restaurant-website-on-google-local-seo-for-wordpress-2025/" title="How to Rank Your Restaurant Website on Google: Local SEO for WordPress (2025)”>Restaurant Website to DoorDash, Uber […]
May 3, 2026
Tutorials

How to Set Up Catering and Large Group Orders on Your WooCommerce Restaurant Website (2026)

Why Catering and Large Group Orders Matter for Restaurant Revenue Most restaurant owners pour energy into optimizing their dine-in experience and individual delivery orders while overlooking a revenue channel that can transform their bottom line: catering. A single corporate lunch order for 30 people can equal what your dining room generates in an entire slow […]
May 2, 2026