News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Cannot sort countries?

Started by vmfyelloq19, May 26, 2020, 08:51:31 AM

Previous topic - Next topic

vmfyelloq19

Hi folks,

I cannot sort countries in VM backend, neither by sorting by drag/drop nor by entering sort order number manually.
As soon as I click on the up/down arrows button in the columns header, order get's messed up.
(.../index.php?option=com_virtuemart&view=country)
Javascript console says:
window.saveorder() is deprecated without a replacement! M226 core.js:1
window.checkAll_button() is deprecated without a replacement! M226 core.js:1

I'm very probably not the first to have a need to sort countries, so I'm sure I', missing something very simple here. Any hints?

TIA!

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

vmfyelloq19

Latest stable (3.6.10 10211)

GJC Web Design

Yes.. on 3.8.0 10311 it seems completely broken -- by drag and drop or manual ordering
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

vmfyelloq19

Thank you GJC Web Design.

So there's no way to sort countries right now?
I cannot launch the shop with messed up country ordering...
I really wouldn't like to do that via SQL, esp- if the shopowner eventually *will* use the countries admin page and mess it up again.

GJC Web Design

Till fixed the only way is to manually enter the order in the ordering column in #__virtuemart_countries

In English they display alphabetically but I know this is not correct if the the country names are changed to other languages
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

vmfyelloq19

Hello GJC Web Design,

thank you for your response. That is bad news!
Is this a confirmed bug on the VM buglist and is there any time frame when it might be fixed?

And since we are at it:
I would like to suggest to allow ordering per language.

Thanks

Milbo

Quote from: GJC Web Design on May 27, 2020, 00:01:55 AM
Till fixed the only way is to manually enter the order in the ordering column in #__virtuemart_countries

In English they display alphabetically but I know this is not correct if the the country names are changed to other languages

No, that was completly sorted. You can order it by using the ordering values, any with 0 are sorted alphabetically after teh language. Even "Östereich" is in german set at the correct place (the value from the db is "austria")
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Quote from: vmfyelloq19 on May 26, 2020, 14:19:09 PM
Latest stable (3.6.10 10211)
Quote from: GJC Web Design on May 26, 2020, 14:26:47 PM
Yes.. on 3.8.0 10311 it seems completely broken -- by drag and drop or manual ordering

You noticed, that you talk about different versions? I am actually surprised that there is any dragndrop. Dragndrop should only appear, when you see all countries. Then it works normally.

It is very rare that people want to sort all countries manually. The countries are already alphabetically sorted. But it makes sense to prefer 1-3 countries and put them on top. More sorting makes no sense.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

vmfyelloq19

#9
Hello Milbo,

that's exactly what we tried to acomplish: sort a handful of common country to top, leave the rest to auto-sort by name.

As initially posted: drag and drop ordering is not working, neither is entering the order-ids manually and clicking on the up-down-arrow "save order" button. Ordering get's messed up any time.

Apart from the UI not working, maybe you could explain the ordering algorithm?
I was on the impression that I cannot have duplcate order ids (as the JS was re-numbering the order-ids iirc)

Certainly it would be perfect to have:
a) Main country - ordering 1 (keep this on top)
b) A handful of important countries - ordering 2 (sort these alphabetically by current language)
c) All other countries - ordering 3 (sort these alphabetically by current language, but after all countries with ordering 1 and 2)

If that's the way the ordering is working I'd be more than fine with that!

TIA!

(Using latest stable 3.8.2 10325 - sorry, got that wrong initially)

jjk

#10
Quote from: vmfyelloq19 on May 27, 2020, 13:02:47 PM
Certainly it would be perfect to have:

That should be pretty easy to achieve.
By default the country list ordering values are all set to '0'. You can enter for example -3 into the ordering field of your preferred (top) country and for example -2 and -1 for two countries that you want to be displayed right below. Then click the 'Save' ordering button (The small button between Ordering and Published). That does work in my case.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

vmfyelloq19

Hello jjk,

maybe did not explain this properly.
Your tip wouldn't work for multi-language sites, consider:

-4 Italy (shop's home counttry on top, fine)
Then:
-3 France (it:Francia)
-2 Sweden (it: Svezia)
-1 United Kingdom (it: Regno Unito)
0 all other countries (make them sorted alphabetically)

Ordering would be wrong for italian, as Regno Unito need to be before Svezia here.
What I tried to say was:
-2 Italy
-1 France (it:Francia)
-1 Sweden (it: Svezia)
-1 United Kingdom (it: Regno Unito)
0 all other countries
where all -1 countries get sorted automatically, as well as all 0 countries.
Something like "order by ordering asc, translated_country_name asc"






jjk

I've used what I wrote on my previous reply for my own multilingual shop. VM keeps the ordering in all languages, in your case --4, -3, -2, -1 and the rest in alphabetical order.
So in Italian the language drop-down would show:
(-4) Italia
(-3) Francia
(-2) Svezia
(-1) Regno Unito
followed by the rest in alphabetical order.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

vmfyelloq19

Hi jjk,

yes. as I wrote, that's the wrong order for italian. It needs to be
Italia
Francia
Regno Unito
Svezia
(other)

while in english it needs to be
Italy
France
Sweden
United Kingdom
(other)