WPSlash

How to Disable Actions and Show an Overlay When Your WooCommerce Store is Closed

Thursday June 2, 2022

If you’re running a WooCommerce restaurant ordering system, you may want to disable ordering and display an overlay when your store is closed or not accepting orders. This ensures that customers know when ordering is unavailable, improving the user experience.

In this guide, we’ll show you how to use a simple PHP snippet to automatically disable WooCommerce orders and display an overlay notification when the store is closed.


Why Disable Actions and Show an Overlay When the Store is Closed?

✔ Prevents customers from placing orders when your restaurant is not operating
✔ Enhances the user experience by providing clear availability updates
✔ Avoids confusion and reduces customer complaints about unexpected order closures
✔ Improves order management for restaurants using WooCommerce

For WooCommerce food delivery websites, this feature is especially useful when using a dedicated ordering plugin like WooFood.


How to Show an Overlay When the Store is Closed in WooFood

To display a store closed overlay when orders are disabled in WooFood, add the following PHP snippet to your theme’s functions.php file:

<?php
add_action( 'wp_footer', 'wpslash_woofood_disabled_store_overlay');

function wpslash_woofood_disabled_store_overlay()
{
   $woofood_options = get_option('woofood_options');
  $order_types = woofood_get_order_types();
  $default_order_type=woofood_get_default_order_type();
  $order_types_enabled_now = array();
  foreach( $order_types as $order_type => $order_type_name)
  {
    $is_enabed = isset($woofood_options["woofood_force_disable_".$order_type."_option"]) ? $woofood_options["woofood_force_disable_".$order_type."_option"] : null;
    if(!$is_enabed)
    {
       $order_types_enabled_now[$order_type] =true;
    }


  }

  if(empty($order_types_enabled_now))
  {
    ?>
<div class="woofood-disabled-overlay">
    <div class="woofood-overlay-content-disabled">
       <?php echo apply_filters('woofood_disabled_overlay_message', esc_html__('Store is currently disabled..', 'woofood-plugin')); ?>
    </div>
    </div>
    <?php
  }


}
?>

How This Code Works

✅ The function wpslash_woofood_disabled_store_overlay() checks whether WooFood ordering is currently disabled.
✅ If all order types (delivery and takeaway) are disabled, it displays an overlay message.
✅ The overlay appears on all pages, preventing users from placing orders.
✅ The CSS styles make the overlay visually clear, with a background notification.


Best Practices for Implementing the Store Closed Overlay

🔹 Customize the overlay message using the WooFood filter hook woofood_disabled_overlay_message.
🔹 Modify the CSS styles to match your restaurant’s branding.
🔹 Test the feature on a staging website before deploying it to your live WooCommerce store.


Looking for an Advanced WooCommerce Food Delivery Solution?

Managing restaurant orders on WooCommerce can be challenging, especially when handling delivery schedules, order restrictions, and customer notifications. If you want a complete restaurant ordering systemWooFood is the best choice.

Why Choose WooFood?

✅ Full WooCommerce integration – Manage all orders from your WordPress dashboard.
✅ Flexible ordering options – Accept both pickup and delivery orders.
✅ Schedule-based ordering – Automatically disable orders when your restaurant is closed.
✅ Custom delivery zones – Set delivery distance restrictions and fees.
✅ Automatic order printing – Print orders instantly for faster kitchen processing.

🚀 Upgrade Your Restaurant’s Ordering System Today!

👉 Check out WooFood – The Ultimate WooCommerce Food Delivery Plugin

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