How to Customise checkout fields (2 posts)

  1. furumachi
    Posted 3 years ago #

    I'd like to change the order of first name and last name fields.

    Default is First Name field + Last Name field.

    But my hope is Last Name field + First Name field.
    (In Japan we describe like this)

    I've read the Tutorial below but could not understand it.

    I would like to get more information.

    The point is;

    1) What name of the file(***.php) should I customise ?

    2) Where is the file ?

    3) How to customise the description in detail ?

    I am waiting for your answer.
    Thank you,


  2. terrytsang
    Posted 3 years ago #

    Hi furumachi. If you like to change the order of first name and last name, there is a quick fix.

    1) Open your theme functions.php (located at wp-content/themes/[your-theme-name]/functions.php)

    2) Add below code at bottom section:

    // Hook in
    add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
    function custom_override_checkout_fields( $fields ) {
    	$fields['billing']['billing_first_name']['class'] = array('form-row-last');
    	$fields['billing']['billing_last_name']['class'] = array('form-row-first');
    	return $fields;

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic