Categories
WooCommerce Extensions

Hide Address Fields for WooCommerce

How to never hide the address fields for purchase above 100?

add_filter( 'haf_hide_address', 'haf_dont_hide_address' );
function haf_dont_hide_address( $if_hide ) {
	if ( 100 <= WC()->cart->get_cart_contents_total() ) {
		return false;
	}
	return $if_hide;
}

How to make the postcode field optional for some country?
You may use the haf_optional_postcode_countries filter. Keep in mind that the built-in WooCommerce postcode validation will not be applied when using the plugin.

Leave a Reply

Your email address will not be published. Required fields are marked *