• Resolved kentent

    (@kentent)


    How can I remove the country line from the shipping address in Invoices and Packing Slips?
    We don’t need it and it’s fouling up our system.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor kluver

    (@kluver)

    Hi @kentent,

    The easiest way to customize the address format on your PDF documents is with our Professional extension. You can customize the address format right in the plugin settings. You can also use a filter to set the address format WooCommerce wide. More information on both options here: Changing the address format

    If you don’t want to store the country at all you might want to remove the field from the checkout with a small code snippet:

    //Unset checkout fields
    add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
    function custom_override_checkout_fields( $fields ) {
         unset($fields['billing']['billing_country']);
         return $fields;
    }

    You should place this code snippet in the functions.php of your child-theme. If you haven’t worked with filters/code snippets or functions.php before please read this: How to use filters

    Plugin Contributor Ewout

    (@pomegranate)

    Actually I would not recommend to remove the country field from the checkout.
    Before WooCommerce 3.5, it would automatically remove the country line from the formatted address (which we retrieve directly from woocommerce as such) if it was the same as the shop base country. They removed this in WooCommerce 3.5, so that the address will always contain the country name for both domestic and non domestic sales. You can revert to the old behavior with a simple code snippet:

    
    add_filter( 'woocommerce_formatted_address_force_country_display', '__return_false' );
    
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Remove Country From Shipping Address’ is closed to new replies.