I have renamed the "shipping_country" label of my woocommerce checkout page successfully using this code:
add_filter( 'woocommerce_checkout_fields', 'rename_woo_checkout_fields' );
function rename_woo_checkout_fields( $fields ) {
$fields['shipping']['shipping_country']['label'] = 'Country';
return $fields;
}
But when I try to add additional labels and placeholders which I want to change, it doesn't work. Well, something strange happens actually. When I refresh the page to apply the changes, it seems to work, but the page is still loading and after a second, reverts back to what it was originally. (the shipping_country field DOES still work, but all of the other fields I add the above happens.
I tried changing the sequence but it does not matter.
The fields I am trying to change which do not work are:
$fields['billing']['billing_address_1']['label'] = 'Address';
$fields['billing']['billing_address_1']['placeholder'] = 'Street and house number';
$fields['billing']['billing_city']['label'] = 'City';
$fields['billing']['billing_postcode']['label'] = 'Postcode';
$fields['shipping']['shipping_postcode']['label'] = 'Postcode';
$fields['shipping']['shipping_city']['label'] = 'City';
$fields['shipping']['shipping_city']['placeholder'] = 'City';
$fields['shipping']['shipping_address_1']['label'] = 'Address';
$fields['shipping']['shipping_address_1']['placeholder'] = 'Street and house number';
$fields['order']['order_comments']['placeholder'] = 'Special notes';
What could it be that is making the page revert the changes before it completes loading the page?