Skip to content

Instantly share code, notes, and snippets.

@dleone81
Last active January 13, 2016 14:51
Show Gist options
  • Save dleone81/fb7e754cc18df6a97f07 to your computer and use it in GitHub Desktop.
Save dleone81/fb7e754cc18df6a97f07 to your computer and use it in GitHub Desktop.
Set required input checkout field
/**
Update functions.php into child theme
this script works for
http://www.iograficathemes.com/documentation/woocommerce-iva-field-premium/
See: https://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/
**/
remove_action( 'woocommerce_billing_fields', 'wciva_custom_billing_fields');
add_action( 'woocommerce_billing_fields', 'override_cf');
function override_cf( $fields ) {
$fields['billing_cf'] = array(
'label' => esc_html__('Codice Fiscale/P.IVA', 'wc-iva'),
'placeholder' => esc_html_x('Codice Fiscale/P.IVA', 'placeholder', 'wc-iva'),
'required' => true,
'class' => array('form-row-first'),
'clear' => true
);
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment