Created
May 22, 2023 15:15
-
-
Save clifgriffin/24102e10dcbbcc3f1bf52c2b578385a9 to your computer and use it in GitHub Desktop.
How to hide the country field with CheckoutWC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_default_address_fields', 'custom_override_default_address_fields', 100000 + 100 ); | |
function custom_override_default_address_fields( $fields ) { | |
$fields['country']['class'] = array( 'cfw-force-hidden' ); | |
$fields['country']['columns'] = 0; | |
$fields['postcode']['columns'] = 6; | |
$fields['state']['columns'] = 6; | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment