Last active
July 2, 2020 05:26
-
-
Save rynaldos-zz/8d3fb8287cf1ee48662b5ca785e13040 to your computer and use it in GitHub Desktop.
IE required code
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( 'woocommerce_checkout_fields', 'custom_override_default_address_fields' ); | |
function custom_override_default_address_fields($fields){ | |
global $woocommerce; | |
$country = $woocommerce->customer->get_billing_country(); | |
if($country == 'IE'){ | |
$fields['billing']['billing_postcode']['required'] = true; | |
$fields['shipping']['shipping_postcode']['required'] = true; | |
} | |
return $fields; | |
} | |
// Did this help? Donate me some BTC: 1BEsm8VMkYhSFJ92cvUYwxCtsfsB2rBfiG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment