Created
February 22, 2021 17:37
-
-
Save Oscar-Abad-Folgueira/cd5c006e699aed25a03994f69693a77a to your computer and use it in GitHub Desktop.
WooCommerce Snippet: Desactivar verificación código postal checkout (campo opcional)
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
<?php | |
/** | |
* @snippet WooCommerce Snippet: Desactivar verificación código postal checkout (campo opcional) | |
* @author Oscar Abad Folgueira | |
* @author_url https://www.oscarabadfolgueira.com | |
* @snippet_url https://www.oscarabadfolgueira.com/ | |
*/ | |
add_filter( 'woocommerce_default_address_fields' , 'oaf_codigo_postal_checkout_opcional' ); | |
function oaf_codigo_postal_checkout_opcional( $campos_checkout ) { | |
$campos_checkout['postcode']['required'] = false; | |
return $campos_checkout; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment