Support

Home Forums Event Espresso Premium Annoying change in UI in 4.6

Annoying change in UI in 4.6

Posted: February 16, 2015 at 12:44 pm

Viewing 15 reply threads


Chris Stambaugh

February 16, 2015 at 12:44 pm

Hi,

Before I upgraded to 4.6, when I went to manually add a registrant (or for that matter when someone registered regularly through the web), the default province (I’m in Canada and that’s the default country) was AB for Alberta.

Now, since upgrading to 4.6, the default choice is the US state of Alabama.

Could this please be put back the way it used to be?

Thanks,

Paul


Josh

  • Support Staff

February 16, 2015 at 4:19 pm

Hi Paul,

Are you sure it didn’t give you a “-please select-” option by default, with a link that let you add a state/province that wasn’t in the list before? The reason I ask is because that’s how 4.4.10 worked. In 4.6 they made some changes which led to removing the “click here to add a new state/province”, but they’ll be adding that back in as soon as they can.


Chris Stambaugh

February 23, 2015 at 11:59 am

I’m now using 4.6.11 and the UI is still annoying in this regard.

It knows the default country is Canada but insists on supply a US state as the default. Doesn’t make sense to me.

Paul


Josh

  • Support Staff

February 23, 2015 at 12:42 pm

Hi Paul,

Do you anticipate having registrations come in from Alabama? If not, you can remove those from the select lists by going into the Event Espresso > General Settings > Countries tab. If you remove all of the states that come before Alberta alphabetically, Alberta will display by default.


Chris Stambaugh

February 23, 2015 at 1:29 pm

I don’t think that’s a realistic option because I’d have to remove all the US states (since they are sorted by US first, than Canadian provinces) and I do have lots of clients from the US. Just the vast majority are from Alberta.

Paul


Sidney Harrell

February 23, 2015 at 2:22 pm

Hi Paul,
You can make it default to Alberta by adding this javascript:

jQuery(document).ready( function($) {
  jQuery("select[id$=state]").val(60);
});


Josh

  • Support Staff

February 23, 2015 at 2:35 pm

Re:

I don’t think that’s a realistic option because I’d have to remove all the US states (since they are sorted by US first,

That is an incorrect assumption. If you remove Alabama, and Alaska, you’ll find it will default to Alberta.


Chris Stambaugh

February 23, 2015 at 3:45 pm

Sidney,

Where would I add that code?

Thanks,

Paul


Dean

February 24, 2015 at 1:41 am

Hi,

The following is based on Sidneys code, you could add it to a site specific plugin:
https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

function a_for_alberta() {
    if ( is_admin() ) {
        ?>
        <script>
        jQuery(document).ready( function($) {
          jQuery("select[id$=state]").val(60);
        });
        </script>
        <?php
    }
}
add_action('admin_head', 'a_for_alberta');


Chris Stambaugh

February 24, 2015 at 10:10 am

Thanks, that code works great for an admin adding a new registrant.

Can we do the same thing on the client side of things?

I really think it makes sense that if the default country is Canada that the default choice for state/province should be Canadian too.

Paul


Lorenzo Orlando Caum

  • Support Staff

February 25, 2015 at 12:27 pm

Hi Paul,

Try this updated version:

function a_for_alberta() {
    if ( is_admin() ) {
        ?>
        <script>
        jQuery(document).ready( function($) {
          jQuery("select[id$=state]").val(60);
        });
        </script>
        <?php
    }
}
add_action('admin_head', 'a_for_alberta');

function a_for_alberta_frontend() {
    if ( is_page( 123 ) ) {
        ?>
        <script>
        jQuery(document).ready( function($) {
          jQuery("select[id$=state]").val(60);
        });
        </script>
        <?php
    }
}
add_action('wp_head', 'a_for_alberta_frontend');

The second function is set to load on the registration checkout page. The value 123 should be changed to the post ID of your actual registration checkout page. This ID can be found by going to the registration checkout WP page in your WP dashboard.


Lorenzo

  • This reply was modified 8 years, 1 month ago by Tony. Reason: Code formatting


Chris Stambaugh

February 25, 2015 at 6:03 pm

Lorenzo,

With that active, the admin module just brings up a blank page.

I had to go back to the previous version to get things working again.

Any ideas?

Paul


Lorenzo Orlando Caum

  • Support Staff

February 25, 2015 at 6:56 pm

Hi Paul, that looks like a formatting issue on the support forum reply as part of the sample code appeared missing when it was actually there. I’ve adjusted it.

Could you give that another try?

You should see something like this instead of blank areas of the code:

http://cl.ly/image/2e3E1w1g1o0R

Thanks


Lorenzo


Chris Stambaugh

February 25, 2015 at 9:16 pm

Lorenzo,

Still getting the same results; a non-working site.

Paul


Lorenzo Orlando Caum

  • Support Staff

February 26, 2015 at 1:25 pm

Hi Paul, I re-tested this (latest version of Event Espresso and WordPress) and it is working without crashing the site in the WP-admin or front-end:

http://cl.ly/image/0S1X1g2r3327

The example that I shared already includes the existing solution that Dean shared. I combined them into one reply so you have a more complete solution — one for the WP dashboard and a new one for the front-end.

If you are copying the new coding with the existing coding in place then that would cause an error.

Could you double-check that isn’t the issue here?

Thanks


Lorenzo


Chris Stambaugh

February 26, 2015 at 1:41 pm

It’s all good to go now.

Thanks for the help.

Paul

Viewing 15 reply threads

The support post ‘Annoying change in UI in 4.6’ 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