newlogowp512

World of WP is for sale!
Interested? Please contact us here.

Add Different Field Types To Checkout Page in WooCommerce

Author:

Date:

The code snippets on this page enable you to add different custom field types to your WooCommerce checkout page.

Note : The code in this post for adding custom fields works with the legacy woocommerce checkout shortcode NOT with the new block checkout which requires a plugin like this to add custom fields.

Field types include :

Text Area

This code adds a text area after the order notes.

add_action( ‘woocommerce_after_order_notes’, ‘add_custom_checkout_field’ ); function add_custom_checkout_field( $checkout ) { echo ” . __(‘Extra Info’) . ”; woocommerce_form_field( ‘delivery_instructions’, array( ‘type’ => ‘textarea’, ‘class’ => array( ‘form-row-wide’ ), ‘label’ => __( ‘Delivery Instructions’ ), ‘placeholder’ =>

This is the first part of the article

Add Different Field Types To Checkout Page in WooCommerce

wpforms banner