Skip to content

Instantly share code, notes, and snippets.

@luizbills
Created September 27, 2016 00:06
Show Gist options
  • Save luizbills/6bd1de7d30e754ab3bb2c6f80a268545 to your computer and use it in GitHub Desktop.
Save luizbills/6bd1de7d30e754ab3bb2c6f80a268545 to your computer and use it in GitHub Desktop.
Remover campos de CPF e CNPJ quando estiver no checkout em inglês
add_filter( 'woocommerce_checkout_fields' , 'prefix_remove_some_checkout_fields' );
function prefix_remove_some_checkout_fields( $fields ) {
if ( $_GET['lang'] === 'en' ) {
unset( $fields['billing']['billing_persontype'] );
unset( $fields['billing']['billing_cpf'] );
unset( $fields['billing']['billing_cnpj'] );
}
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment