WPSlash

Setup WooFood for Table Orders only

If you want to setup WooFood to accept orders using only a table number the below hook will help you setup it in no time.

You have to change only the Table Number and the $I based on the maximum number of tables you have

add_filter('woocommerce_checkout_fields', function($fields) {
	 $tables = array();
	for($i = 1; $i <= 60 ; $i++)
	{
			 $tables[$i] = $i;

	}
	$fields['billing']['billing_first_name']['type'] = 'select';
	$fields['billing']['billing_first_name']['options'] = $tables;
	$fields['billing']['billing_first_name']['label'] = 'Table Number';
    unset($fields['billing']['billing_last_name']);
    unset($fields['billing']['billing_company']);
    unset($fields['billing']['billing_address_1']);
    unset($fields['billing']['billing_address_2']);
    unset($fields['billing']['billing_city']);
    unset($fields['billing']['billing_postcode']);
    unset($fields['billing']['billing_country']);
    unset($fields['billing']['billing_state']);
    unset($fields['billing']['billing_phone']);
    unset($fields['shipping']['shipping_first_name']);
    unset($fields['shipping']['shipping_last_name']);
    unset($fields['shipping']['shipping_company']);
    unset($fields['shipping']['shipping_address_1']);
    unset($fields['shipping']['shipping_address_2']);
    unset($fields['shipping']['shipping_city']);
    unset($fields['shipping']['shipping_postcode']);
    unset($fields['shipping']['shipping_country']);
    unset($fields['shipping']['shipping_state']);
    unset($fields['order']['order_comments']);
    unset($fields['billing']['billing_email']);
    unset($fields['account']['account_username']);
    unset($fields['account']['account_password']);
    unset($fields['account']['account_password-2']);

	return $fields;
});

Leave a Comment

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

Related Articles

Tutorials

How to Build an Email Marketing Funnel for Your Restaurant: Automated Campaigns, Order Follow-Ups, and Promotional Emails with WooCommerce and Mailchimp (Complete Guide)

Why Email Marketing Is Essential for Restaurant Websites (and How It Differs from Other Industries) Every time a customer orders through DoorDash, Uber Eats, or Grubhub, you’re renting access to your own audience. The third-party platform owns the customer relationship, controls the data, and charges you anywhere from 15% to 30% per order for the […]
March 31, 2026
Tutorials

How to Speed Up Your WooCommerce Restaurant Ordering Site for Peak Hours: Complete Performance Optimization Guide (Caching, Database Tuning, and CDN Setup)

Why Restaurant Ordering Sites Crash During Peak Hours (And What Makes Them Different from Regular WooCommerce Stores) It’s 6:47 PM on a Friday. Your restaurant’s online ordering system just got shared on a local Facebook group, and suddenly 200 people are trying to place dinner orders at the same time. The site slows to a […]
March 30, 2026
Tutorials

How to Configure Allergen Disclosures, Tax Rules, and ADA Accessibility Compliance for Your WooCommerce Restaurant Ordering Website (Complete Legal Compliance Guide)

Why Legal Compliance Matters for Online Restaurant Ordering Sites Running a restaurant website isn’t just about beautiful food photos and a smooth checkout. The moment you accept orders online, you step into a regulatory landscape that spans food safety law, tax code, disability rights, and data privacy — often simultaneously. And the consequences of getting […]
March 30, 2026