Skip to content

Instantly share code, notes, and snippets.

@rynaldos-zz
Last active July 2, 2020 05:26
Show Gist options
  • Save rynaldos-zz/8d3fb8287cf1ee48662b5ca785e13040 to your computer and use it in GitHub Desktop.
Save rynaldos-zz/8d3fb8287cf1ee48662b5ca785e13040 to your computer and use it in GitHub Desktop.
IE required code
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