Support

Support is part of Event Gallery Extended.

Please get a subscription if you need support. Feel free to use the ticket system or the contact form for reporting defects or pre-sale questions. Make sure you're logged in in order to be able to create a new ticket.

For general information you can also jump to the manual.

Subscribe now!

#2410 Country dropdown ordering

Posted in ‘Event Gallery Extended’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by WSP on Saturday, 05 November 2016 13:00 UTC

WSP
 Hi,

In the checkout process, the Country drop down field contains countries that are not in alphabetical order. I am hoping to use this primarily for the United Kingdom, but this entry is between Gabon and Grenada - very hard to find if you don't know it's there.

Is there an easy way of altering the order of these items so that they're either alphabetical, or can I put the United Kingdom right at the top next to United States?

Also I would like the ability to add States as well, so that UK counties can be selected. I saw a solution in ticket #2136 that involved database tables so I'll look there first and see what I can do. In that ticket, you stated that you'd consider adding back-end functionality for this if there was a demand, so I'd like to add my name to the list of people who'd like to see this in a future update.

Thanks.

WSP
Update:  I have checked the database for the country list but only found the state list there, so I Grep'ed the PHP code and found the list in "com_eventgallery/library/common/geoobjects.php".

I tried manually altering the list that makes up the array in to a better order but it didn't work, presumably because the drop-down element sorts the list by country code.  So then I changed the country codes to a numbered sequence in order to force an order for the list.  This worked!!

I've also kept some social expectations in place (e.g. putting "Holy See" in the "V" section because it's in the Vatican, put ting "British Indian Ocean Territory" in the "I" section as that's where people are likely to look for it, etc).  In addition, I also left deliberate gaps in the number sequence to allow for changes and additions to the list more easily in future.

I changed nothing else whatsoever in the file and have attached it to this ticket for you to inspect.  Maybe you can spot something wrong that means I'm heading for disaster with this mod.  Maybe it might turn out to be some useful groundwork that you can modify and incorporate in to a future update to save you time fixing this small but fiddly issue.

If you can spot a problem with what I've done I'd appreciate your input to avoid future problems or knock-on issues, but if this is a 'clean fix', then I'd appreciate knowing that too.  You are the experts with this software, not me, so I'd appreciate your feedback greatly.

Many thanks!


On 02/11/2016 13:43, Sven Bluege wrote:

sbluege
:) Can you send this file to svenbluege@gmail.com please? Uploading PHP stuff is not allowed here :)

WSP
Done!

sbluege
Well.. that is not a good idea. The country IDs like GB or DE need to stay in place. I'll add an item to my list to sort this stuff by display name instead of by id.

WSP
Thanks. That should hopefully be a better experience for the end-users. Would there still be a way of entering a 'default'? It's a wish-list-item rather than a bug, but as 99% of my business is in my home country (as it is with most photographers), it would be fantastic to be able to set that as the default, rather than making every customer search every time). I look forward to the update that contains the 'display name' change.

In the mean-time, is there a non-destructive way of customising things so that either putting the UK in the "U" section (or better yet at the top), because having it in the "G"s has caused issues with all of my beta testers (so I assume customers will find it difficult as well). (United Kingdom and Great Britain are different regions - GB excludes Northern Ireland and various other United Kingdom islands & territories dotted about the place).

Also, regarding States, I found the database table that handles this and could spend a lot of time creating new entries to add British counties, but it's really difficult doing this manually via phpMyAdmin. I don't want to waste time doing this if it's on your list for a back-end interface that handles this in the next update so please let me know if that's the case. If not, I would want to put the UK counties ahead of the US states but would still want the US states included (as I serve both markets), so I assume I'd have to give the UK counties lower ID numbers, yes? If so, would a break in the ID numbers cause a problem with your software (e.g. if I renumbered all US states to begin at 1000 and then added UK counties before then, would the gap between the last UK county and the first US state cause breakage? Also, would my database alterations be wiped-out when I install the next update?

Thanks once again for all your help!

sbluege
Do you need this state dropdown at all? You can hide it using the components options. Same for the country select field.

I'll upload a version to the developer download section which sorts the countries by display name so at least this will work. If you change the states I'm fine with this. Please don't expect a editor soon. It's not very high on my todo list.

WSP
Thank you.

I've altered the 'States' database and added all the UK counties. I've attached a CSV file of the 'eventgallery_state' database table in case this work is of use to you or anyone else (it's easily importable using phpMyAdmin).

Thanks for sorting the 'sorting' issue with the developer's edition. Is v3.6.3 the one with this fix in it or is it not yet in the downloads section?

The only other question I had was - Is there a way to set a 'default' country that shows instead of the "----" when the page is loaded? Even if it's something I can add to a PHP file somewhere, I'm happy to do it as long as you point me in the right direction.

Many thanks again!

sbluege
Version 3.6.3 is right. You can check the PDF so see the release notes for each upload.

Check the checkout tab in the components options for the country preselection. I uploaded a new version.

WSP
You're an absolute superstar Sven! Thank you thank you thank you!

The checkout page is now perfect!

Thanks again!