I'm using Virtuemart 3.0.8 with the latest Joomla 3.4.1.
Everything is working 100% properly like it should. I have no issues there.
On the Cart page, when the users selects their country from the dropdown box, it lists them in alphabetical order, starting with Afgahnistan.
How can I re-order them?
I don't believe there is any administration setting to do that, so I could a few code changes will be required. if I'm wrong, though, let me know. I've tried renaming Afghanistan to see if if stays first, but it doesn't - so the list is alphabetized somehow. I used to know how to re-order them with a few code changes in VM2, but that doesn't work here in VM3.
Essentially, I'm looking to put "US", "Canada", and "UK" at the top of the list, then the rest of the countries in alphabetical order.
Anyone have a few ideas, or lines of code I can edit a file with?
Thanks!
There is an ordering field in the country database that appears to not show in the administration field for countries
I shall see if anyone knows why this is not used
Thanks for checking into it.
For fun, I modified the ID and Ordering values in the actual Database, but it didn't have any effect on the site's country order. Thought I'd test.
Alternatively, I came up with the idea that if I changed the name of "Canada" to "-- Canada --" and "United States" to "-- United States --", that alphabetically they would be listed first, and it would be an acceptable workaround.
It worked in the admin - they are listed above Afghanistan in the country list. BUT on the front end, in the actual cart dropdown, the "--" are filtered out of the name.
Anyone have any ideas what line of code strips out the non-alphabetical characters out of the Country name? If figure, if I could remove that filter, that I'd have an acceptable solution for the moment. Thanks!
function renderCountryList()
components\com_virtuemart\helpers\shopfunctionsf.php ~ line 174
the list is got from function getCountries() administrator\components\com_virtuemart\models\country.php ~ line 93
you could change the query there to take notice of the order
Hi,
might be you could try to change ordring in this file: administrator/components/com_virtuemart/helpers/vmmodel.php
line 651 _getOrdering function