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

Restaurants Tutorials

The Cheapest Food Delivery App for Restaurants Isn’t an App at All — It’s WooFood

When restaurant owners start looking for the cheapest food delivery app, they quickly discover a frustrating truth: most “cheap” delivery platforms aren’t cheap at all. They either take commissions, charge high monthly fees, lock you into their payment processors, or limit how much control you have over your own customer base. But what if the […]
December 1, 2025
Restaurants WooFood

Why “Free” GloriaFood Might Not Be The Best Long-Term Bet For Your Restaurant

When you’re building an online ordering system for your restaurant, it’s tempting to go for a “free” solution. That’s exactly what GloriaFood offers: a ready-to-go, easy-to-install WordPress plugin for online ordering, delivery, and reservations with no setup fees or commissions But “free” doesn’t always mean “best,” especially when you’re serious about owning your brand, your […]
December 1, 2025
Tutorials WooCommerce

How to Choose the Best Food Ordering System for Your Restaurant (And Why WooFood is the Ultimate Solution)

If you’re running a restaurant, café, or fast-food business in today’s digital age, offering online food ordering is no longer optional — it’s essential. Customers expect the convenience of browsing your menu, customizing their orders, and checking out seamlessly from their phone or computer. But with so many plugins and systems available, how do you choose the right […]
April 21, 2025