Last active
September 13, 2023 08:08
-
-
Save xlplugins/5e57c84962d23e2edf24b0c35ca8a9bb to your computer and use it in GitHub Desktop.
php field validation on checkout page
This file contains 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
add_filter( 'wfacp_checkout_fields', 'ocultar_validar_cuit_cuilde_ar', 20 ); | |
function ocultar_validar_cuit_cuilde_ar( $fields ) { | |
// Verificar si el país seleccionado es Argentina (código de país: AR) | |
if ( isset( $_POST['billing_country'] ) && $_POST['billing_country'] !== 'AR' ) { | |
// Deshabilitar la validación del campo 'billing_cuitcuil' | |
$fields['advanced']['billing_cuitcuil']['required'] = false; | |
} | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment