How to add a GST number field to WooCommerce checkout and order emails
If you’re running a WooCommerce store in India or working with B2B clients, you may need to collect GST numbers during checkout. In this tutorial, you’ll learn how to add an optional GST number field on the WooCommerce checkout page, save it with the order , and display it in the admin panel as well as in the order confirmation emails . Step 1: Add GST Number Field to Checkout Page Use the following code in your theme functions.php file to add a new optional field for the GST number just below the billing fields. // Add GST Number field to checkout add_action('woocommerce_after_checkout_billing_form', 'add_gst_field_to_checkout'); function add_gst_field_to_checkout($checkout) { echo '<div id="gst_number_field"><h3>' . __('GST Number (Optional)') . '</h3>'; woocommerce_form_field('gst_number', array( 'type' => 'text', 'class' => array(...