WPSlash

How to Set Different Minimum Delivery Amounts for Each Location in WooFood

Monday June 14, 2021

If you’re using WooFood – the WooCommerce food delivery plugin, you may want to set different minimum order amounts depending on the location. This is especially useful for restaurants with multiple branches or different delivery zones, ensuring that delivery costs are covered efficiently.

In this guide, we’ll show you how to use a simple WooCommerce hook to set custom minimum delivery amounts per location using a code snippet in your WordPress child theme’s functions.php file.


Why Set a Minimum Delivery Amount Per Location?

✔ Custom pricing for different areas – Prevents low-value orders in high-cost delivery zones.
✔ Supports multiple store locations – Assign a different minimum order amount for each branch.
✔ Ensures profitability – Encourages larger orders for more distant locations.
✔ Seamless WooCommerce integration – Works perfectly with the WooFood plugin.

This setup is ideal for restaurant chains, multi-location businesses, and WooCommerce stores that offer delivery to different regions.


How to Set Different Minimum Delivery Amounts Per Location in WooFood

To customize the minimum order amount for each store location, add the following PHP snippet to your theme’s functions.php file:

<?php
add_action( 'woocommerce_checkout_process', 'woofood_custom_hook_minimum_per_store', 9999999 );
 function woofood_custom_hook_minimum_per_store() {
   global $woocommerce;



    if (isset($_POST["extra_store_name"])) {

      //35 is the store id //

    if ($_POST["extra_store_name"] == "35")
    {
          wc_add_notice( 
                sprintf(  __( 'You must have an order with a minimum of %s to place your order, your current order total is %s.', 'woofood-plugin' ) , 
                    wc_price( 20 ), 
                    wc_price( WC()->cart->subtotal )
                ), 'error' 
            );

    }
          //34 is the store id //

    else if($_POST["extra_store_name"] == "34")
    {
         wc_add_notice( 
                sprintf(  __( 'You must have an order with a minimum of %s to place your order, your current order total is %s.', 'woofood-plugin' ) , 
                    wc_price( 25 ), 
                    wc_price( WC()->cart->subtotal )
                ), 'error' 
            );
    }

      

    }
}

?>

How This Code Works

✅ The woocommerce_checkout_process hook ensures the minimum order validation happens during checkout.
✅ The function woofood_custom_hook_minimum_per_store() checks the store ID selected by the customer.
✅ Different minimum order amounts are applied based on the store location.
✅ If the customer’s order subtotal is below the required minimum, an error message prevents checkout.


Best Practices for Implementing Location-Based Minimum Delivery Amounts

🔹 Ensure your store locations are properly configured in WooFood.
🔹 Modify store IDs and minimum order values to match your restaurant’s requirements.
🔹 Test the code in a staging environment before deploying it to your live site.
🔹 Combine this feature with delivery zone-based pricing for more accurate delivery cost control.


Looking for a Complete WooCommerce Food Delivery Solution?

If you’re running a restaurant or food delivery business with multiple locations, you need a robust WooCommerce food ordering plugin that supports:

✅ Custom delivery pricing per location
✅ Minimum order restrictions based on delivery zones
✅ Pickup and delivery order management
✅ Real-time order processing

With WooFood – WooCommerce Food Delivery Plugin, you can fully automate your restaurant’s online ordering system, optimize the checkout process, and increase revenue with custom pricing strategies.

🚀 Upgrade Your WooCommerce Food Ordering System Today!

👉 Get WooFood here and take your restaurant website 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