How to Use WooFood for Table Ordering

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',...

August 12, 2020 WPSlash

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();
	
	}
}

Commission-free ordering

Run restaurant orders on your own WordPress site

FoodMaster adds delivery, pickup, dine-in, POS, and kitchen tools — with zero per-order fees.

Get FoodMaster

Leave a Comment

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

×

🔥 ONE DAY ONLY OFFER 🔥

Upgrade FoodMaster Today

Normally your license is limited to 1 Website.

Today only, get a LIFETIME Unlimited Websites License for just:
$499

✔ Unlimited Client Websites
✔ Unlimited Personal Projects
✔ Future Updates Included
✔ Save Hundreds on Additional Licenses

Offer Ends In: