You can add your own field to the WooCommerce checkout page, such as Delivery Instructions, Company Name, or GST Number.
Steps
- Open your theme’s
functions.phpfile. - Add the code below.
- Save the file.
- Open the WooCommerce Checkout page.
Done — a new Delivery Instructions field will appear in the checkout form.
function add_delivery_instructions_field( $fields ) {
$fields['billing']['delivery_instructions'] = array(
'type' => 'textarea',
'label' => 'Delivery Instructions',
'placeholder' => 'Enter any special delivery instructions',
'required' => false,
'class' => array( 'form-row-wide' ),
'priority' => 120,
);
return $fields;
}
add_filter(
'woocommerce_checkout_fields',
'add_delivery_instructions_field'
);