I have added a custom list of states to my woocommerce using the code here: https://docs.woocommerce.com/document/addmodify-states/
The newly added states load fine on frontend and some backend screens, however in e-mails and user account screen, woocommerce only loads the the code / value instead of the actual name. (XX1, XX2 etc.)
I believe I can fix it using this logic:
echo WC()->countries->states[$current_user->billing_country][$current_user->billing_state]; //to get State name by state code
So I was wondering if it's possible to use this logic to create a function that would print the state name whenever the template calls the code? Any help would be very much appreciated.