Posted: September 18, 2019 at 5:04 am
How do I set the system so that our reports list the registrant’s state with the two-letter abbreviation only and not the full listing of the state? Our meeting planner uses the Excel spreadsheets to create name tags and has to manually change all of them, which is time consuming. Is there a way to only display the initials? |
|
Hi Rob, There is a way and involves adding a bit of PHP code that hooks in to the CSV report array. Here’s a code snippet that makes the swap to State abbreviations: You can add the above to a functions plugin, then activate the plugin. |
|
Not super comfortable tweaking PHP. It appears an easier workaround is to change the state name in the listings to just the abbreviation. Can I put the full state name in the “code” column or will that screw things up? |
|
Hi Rob, The gist Josh gave you specifically targets the CSV state column and changes it to what you have requested, it’s a minor change with no other complications as it doesn’t change anything within the database and just pulls the State Adv for the selected state and uses that in place of the original value. Going through with your workaround you are changing how EE expects the data to be set up in the database and repurposing a value for something else. Changing a value that is expected (in this case State name but this applies anywhere) to something unexpected could cause further issues down the line. Will it in this case? I’m not sure but it is still not something we can recommend. If you follow the instructions in the link Josh gave you (THIS) it walks you through how to create a custom functions plugin where you can store any custom functions for your site. It is pretty much copy and paste for the most part but teaches you how to use a plugin to store your functions so the next time you want to make a change that needs a snippet, you know how to add it to that same plugin. If you prefer I can put that function into a functions plugin for you which you can install on the site? I’d basically just be following the instructions on that link above. I do recommend you work through adding that function so you know what is going on and how to create and edit a plugin, but if you prefer not to thats fine. |
|
Hey it worked! Thank you for the detailed instructions! Did a test registration, and the report now just has the state abbreviations. Thank you! |
|
You’re most welcome 🙂 Any further problems/question just let us know. |
|
The support post ‘State Abbreviations’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.