Created
September 30, 2020 03:26
-
-
Save gamaup/2faa4f6e0e3f78ad443dfbd087cb2f52 to your computer and use it in GitHub Desktop.
Change Checkout Address Label
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 | |
// method 1. | |
add_filter( 'woocommerce_checkout_fields', function( $fields ) { | |
$fields['billing']['billing_state']['label'] = 'Provinsi'; | |
$fields['billing']['billing_city']['label'] = 'Kabupaten'; | |
$fields['billing']['billing_district']['label'] = 'Kecamatan'; | |
$fields['shipping']['shipping_state']['label'] = 'Provinsi'; | |
$fields['shipping']['shipping_city']['label'] = 'Kabupaten'; | |
$fields['shipping']['shipping_district']['label'] = 'Kecamatan'; | |
return $fields; | |
}, 99 ); | |
// method 2. | |
add_filter( 'woocommerce_billing_fields', function( $fields ) { | |
$fields['billing_state']['label'] = 'Provinsi'; | |
$fields['billing_city']['label'] = 'Kabupaten'; | |
$fields['billing_district']['label'] = 'Kecamatan'; | |
return $fields; | |
}, 99 ); | |
add_filter( 'woocommerce_shipping_fields', function( $fields ) { | |
$fields['shipping_state']['label'] = 'Provinsi'; | |
$fields['shipping_city']['label'] = 'Kabupaten'; | |
$fields['shipping_district']['label'] = 'Kecamatan'; | |
return $fields; | |
}, 99 ); | |
// method 3. | |
add_filter( 'woocommerce_get_country_locale', function( $fields ) { | |
$fields['ID']['state']['label'] = 'Provinsi'; | |
$fields['ID']['city']['label'] = 'Kabupaten'; | |
return $fields; | |
}, 99 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment