Dropping Address Line 2 from Billing Address
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 18 Feb 2016 19:48:44 +0000 (14:48 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 18 Feb 2016 19:48:44 +0000 (14:48 -0500)
functions.php

index 424b056..434c8d3 100755 (executable)
@@ -287,4 +287,11 @@ function glm_change_order_status_names( $order_statuses ) {
 add_filter( 'wc_order_statuses', 'glm_change_order_status_names' );
 */
 
+// Drop billing address line 2 in WooCommerce checkout page
+function custom_wc_checkout_fields( $fields ) {
+    unset($fields['billing']['billing_address_2']);
+    return $fields;
+}
+add_filter( 'woocommerce_checkout_fields' , 'custom_wc_checkout_fields' );
+
 ?>