Skip to content

Instantly share code, notes, and snippets.

@jaccon
Created November 15, 2022 19:05
Show Gist options
  • Save jaccon/8ccc451484bf1d2a55148d5d9bf0535e to your computer and use it in GitHub Desktop.
Save jaccon/8ccc451484bf1d2a55148d5d9bf0535e to your computer and use it in GitHub Desktop.
function fluidcheckout_change_billing_address_fields_args( $fields ) {
if ( array_key_exists( 'billing_state', $fields ) ) { $fields[ 'billing_state' ][ 'class' ][] = 'update_totals_on_change'; }
if ( array_key_exists( 'billing_city', $fields ) ) { $fields[ 'billing_city' ][ 'class' ][] = 'update_totals_on_change'; }
if ( array_key_exists( 'billing_postcode', $fields ) ) { $fields[ 'billing_postcode' ][ 'class' ][] = 'update_totals_on_change'; }
return $fields;
}
add_filter( 'woocommerce_billing_fields', 'fluidcheckout_change_billing_address_fields_args', 300 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment