• Resolved nesoor

    (@nesoor)


    Hello WordPress members !
    I would like to remove the below field from the checkout page.
    Field: apartment suite unit etc. (optional)
    When I use display none it still appears on the invoice so I would really like it to be completely disabled. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Rynald0s.a11n

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy!

    You can use the following code:

    add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );
     
    function custom_remove_woo_checkout_fields( $fields ) {
    unset($fields['billing']['billing_address_2']);
    unset($fields['shipping']['shipping_address_2']);
    return $fields;
    }

    Further information can be found here:

    https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/

    This custom code should be added to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as Code Snippets. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update.

    Cheers!

    Plugin Support Rynald0s.a11n

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy!

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Cheers!

    Thread Starter nesoor

    (@nesoor)

    Hey Rynalds0s,

    Sorry, I forgot to reply !
    That was exactly what I needed 🙂 Thanks !

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to remove an order field ?’ is closed to new replies.