Author Topic: Cannot sort countries?  (Read 1837 times)

vmfyelloq19

  • Jr. Member
  • **
  • Posts: 50
  • A beginner
Cannot sort countries?
« on: May 26, 2020, 08:51:31 am »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28389
  • Always on vacation
    • Jenkin Hill Internet
Re: Cannot sort countries?
« Reply #1 on: May 26, 2020, 11:29:57 am »
VM version?
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart 4.0.8 10748  J3.10.11 PHP 7.4.30

vmfyelloq19

  • Jr. Member
  • **
  • Posts: 50
  • A beginner
Re: Cannot sort countries?
« Reply #2 on: May 26, 2020, 14:19:09 pm »
Latest stable (3.6.10 10211)

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10637
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Cannot sort countries?
« Reply #3 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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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

  • Jr. Member
  • **
  • Posts: 50
  • A beginner
Re: Cannot sort countries?
« Reply #4 on: May 26, 2020, 18:53:13 pm »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10637
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Cannot sort countries?
« Reply #5 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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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

  • Jr. Member
  • **
  • Posts: 50
  • A beginner
Re: Cannot sort countries?
« Reply #6 on: May 27, 2020, 11:44:08 am »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10466
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Cannot sort countries?
« Reply #7 on: May 27, 2020, 12:03:34 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10466
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Cannot sort countries?
« Reply #8 on: May 27, 2020, 12:10:36 pm »
Latest stable (3.6.10 10211)
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

  • Jr. Member
  • **
  • Posts: 50
  • A beginner
Re: Cannot sort countries?
« Reply #9 on: May 27, 2020, 13:02:47 pm »
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3749
  • using Matomo instead of Google Analytics
Re: Cannot sort countries?
« Reply #10 on: May 27, 2020, 20:41:13 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

  • Jr. Member
  • **
  • Posts: 50
  • A beginner
Re: Cannot sort countries?
« Reply #11 on: May 28, 2020, 09:46:00 am »
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3749
  • using Matomo instead of Google Analytics
Re: Cannot sort countries?
« Reply #12 on: May 28, 2020, 11:33:00 am »
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

  • Jr. Member
  • **
  • Posts: 50
  • A beginner
Re: Cannot sort countries?
« Reply #13 on: May 28, 2020, 13:02:44 pm »
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)