WooCommerce Change Form Labels and Remove Fields

I’m trying to customise WooCommerce checkout page, how can I edit field labels?

Also, how can I remove 2 fields from the form? I don’t need Company and State field.

Related posts

Leave a Reply

3 comments

  1. I recommend making a custom plugin that modifies this so you can easily upgrade WooCommerce at a later date.

    In your custom plugin, implement some of the code found on here: http://wcdocs.woothemes.com/snippets/tutorial-customising-checkout-fields-using-actions-and-filters/

    For example, to remove Company and State:

    // Hook in
    add_filter( 'woocommerce_checkout_fields', 'custom_override_checkout_fields' );
    // Our Hooked in function - $fields is passed via the filter
    function custom_override_checkout_fields( $fields) {
        unset($fields['shipping']['shipping_state']);
        unset($fields['shipping']['shipping_company']);
        return $fields;
    }
    

    If you need help making a Plugin, I made a guide on how to add custom fields to the Product page. I think it might be helpful in this context.
    http://www.xatik.com/2013/02/06/add-custom-form-woocommerce-product/

  2. Here is a working hook that you need to add into your theme’s functions.php file

    add_filter( 'woocommerce_checkout_fields' , 'remove_checkout_fields' );
    
    function remove_checkout_fields( $fields ) {
        unset($fields['billing']['billing_state']);
        unset($fields['billing']['billing_company']);
        unset($fields['billing']['billing_country']);
        return $fields;
    }