Make Billing and Shipping Fields Optional and required in WooCommerce For not required country first_name last_name company address_1 address_2 city state postcode add_filter( 'woocommerce_default_address_fields' , 'optional_default_address_fields' ); function optional_default_address_fields( $address_fields ) { $address_fields['company']['required'] = false; $address_fields['postcode']['required'] = false; $address_fields['city']['required'] = false; $address_fields['state']['required'] = false; return $address_fields; } For required add_filter( 'woocommerce_default_address_fields' , 'optional_default_address_fields' ); function optional_default_address_fields( $address_fields ) { $address_fields['company']['required'] = true; $address_fields['postcode']['required'] = true; ...
We provide knowledgeable blogs related to php, jQuery, html, css, wordpress, woocommerce, cordova app with examples in 2021.