Sorting Of Addresses in checkout

  • Posts: 199
  • Thank you received: 16
3 weeks 13 hours ago #308094

I have a site where the head office is placing orders for almost 100 outlets and the outlet addresses are all listed for selection using the dropdown method. I want to sort the display order of the addresses by the city.

To do this I presume I need to modify address_select.php What changes are needed there or am I on the wrong track?

Last edit: 3 weeks 13 hours ago by rodfarrell.

Please Log in or Create an account to join the conversation.

  • Posts: 66303
  • Thank you received: 9727
  • MODERATOR
2 weeks 6 days ago #308108

Hi,

You would have to change the line:

$query = 'SELECT a.* FROM '.hikashop_table('address').' AS a WHERE '.implode(' AND ', $filters).' ORDER BY a.address_default DESC, a.address_id DESC';
to:
$query = 'SELECT a.* FROM '.hikashop_table('address').' AS a WHERE '.implode(' AND ', $filters).' ORDER BY a.address_city ASC';
in the file administrator/components/com_hikashop/classes/address.php

Please Log in or Create an account to join the conversation.

  • Posts: 199
  • Thank you received: 16
2 weeks 3 days ago #308196

Hi Nicolas, you solution worked (of course) but I'm having a bit of a brain fade moment. How do I save that change as a template override?

Please Log in or Create an account to join the conversation.

  • Posts: 11981
  • Thank you received: 1651
  • MODERATOR
2 weeks 2 days ago #308199

Hello,

Hikashop classes are different than Hikashop views files so you'll have to re-apply that patch after every updates.

Kind regards,
Mohamed Thelji.

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum