WPSlash

Disable Cash On Delivery for Delivery Orders on WooFood

Friday December 4, 2020

Here is a small code snippet you can add on your site to disable COD for Delivery Orders . You can still able to use COD on Pickup Orders.

Just copy and paste the following snippet to your functions.php inside your child theme

function wpslash_payment_gateway_disable_for_delivery( $available_gateways ) {
global $woocommerce;
    unset(  $available_gateways['cod'] );

return $available_gateways;
}




add_action("woofood_checkout_triggers", "wpslash_disable_payment_methods_by_order_type", 10, 2);
function wpslash_disable_payment_methods_by_order_type($data, $order_type)
{



     if ( $order_type == 'delivery' ) {

      add_filter( 'woocommerce_available_payment_gateways', 'wpslash_payment_gateway_disable_for_delivery' );
    } 

}

Leave a Comment

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

Related Articles

Tutorials

How to Manage Multiple Restaurant Locations with WooCommerce: Separate Menus, Delivery Zones, and Unified Reporting for Multi-Branch Food Businesses (Complete Guide)

Why Multi-Location Restaurant Management in WooCommerce Is Challenging (and Worth Solving) Running a single restaurant online is straightforward enough. But the moment you open a second location — or a third, or a fifth — everything multiplies in complexity. Suddenly you’re juggling separate menus where Location A serves a breakfast burrito that Location B doesn’t […]
April 3, 2026
Tutorials

How to Set Up SMS Order Notifications and Text Message Marketing for Your WooCommerce Restaurant: Automated Alerts, Promotional Campaigns, and Customer Engagement (Complete Guide)

Why SMS Notifications Matter for Restaurant Online Ordering A customer places a lunch order from their desk at 11:45 AM. They’re hungry, they’re on a tight break, and they need to know exactly when their food will be ready. They’re not going to check their email — they’re watching their phone. This is precisely why […]
April 3, 2026
Tutorials

How to Set Up Gift Cards and Store Credit for Your WooCommerce Restaurant: Boost Revenue, Attract New Customers, and Drive Repeat Orders (Complete Setup Guide)

Why Gift Cards and Store Credit Are a Game-Changer for Restaurants A customer buys a $50 gift card for their friend’s birthday. That friend — someone who may have never heard of your restaurant — places their first order, spends $62 (because gift card holders almost always spend beyond the card’s value), and becomes a […]
April 2, 2026