WPSlash

How to Use WooFood for Table Ordering

Wednesday August 12, 2020

If you are thinking to use WooFood for in-table ordering here is a small code snippet that will get automatically get the table number .

The below code can be added on functions.php of your child theme.

With the below code you can set the parameter table to the table number like

https://www.yoursite.com/?table=45

add_action( 'wp_head', 'wpslash_custom_check_for_table_param' );

function wpslash_custom_check_for_table_param() {
	global $woocommerce;
     if( isset( $_GET['table'] ) ) {
		 WC()->customer->set_billing_first_name($_GET['table']);

     }
	if(empty(WC()->customer->get_billing_first_name()))
	{
wc_add_notice('Scan QR Code to continue ordering', 'error' );
wc_print_notices();
	
	}
}

Leave a Comment

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

Related Articles

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
Tutorials

How to Set Up a Kitchen Display System (KDS) for Your WooCommerce Restaurant: Replace Paper Tickets with Real-Time Digital Order Screens (Complete Setup Guide)

What Is a Kitchen Display System (KDS) and Why Your Restaurant Needs One Picture this: your restaurant’s lunch rush hits, online orders pour in through your WooCommerce site, and your kitchen printer jams. Tickets pile up, orders get lost, and customers wait. A Kitchen Display System (KDS) eliminates that entire failure point by replacing paper […]
April 2, 2026