Support

Home Forums Event Espresso Premium State Abbreviations

State Abbreviations

Posted: September 18, 2019 at 5:04 am

Viewing 5 reply threads


Rob Betz

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?


Josh

  • Support Staff

September 18, 2019 at 7:32 am

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:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/admin/registration-reports/core/jf_ee_csv_report_change_state_to_abbreviation.php

You can add the above to a functions plugin, then activate the plugin.


Rob Betz

September 18, 2019 at 7:58 am

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?


Tony

  • Support Staff

September 18, 2019 at 8:22 am

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.


Rob Betz

September 18, 2019 at 8:43 am

Hey it worked! Thank you for the detailed instructions! Did a test registration, and the report now just has the state abbreviations. Thank you!


Tony

  • Support Staff

September 18, 2019 at 8:48 am

You’re most welcome 🙂

Any further problems/question just let us know.

Viewing 5 reply threads

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.

Event Espresso