Sorting Of Addresses in checkout

  • Posts: 249
  • Thank you received: 21
  • Hikashop Business
4 years 9 months 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: 4 years 9 months ago by rodfarrell.

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
4 years 9 months 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: 249
  • Thank you received: 21
  • Hikashop Business
4 years 8 months 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: 12953
  • Thank you received: 1778
4 years 8 months 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.070 seconds
Powered by Kunena Forum