Sorting Of Addresses in checkout

  • Posts: 216
  • Thank you received: 18
  • Hikashop Business
5 months 1 week 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: 5 months 1 week ago by rodfarrell.

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

  • Posts: 67623
  • Thank you received: 10041
  • MODERATOR
5 months 1 week 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: 216
  • Thank you received: 18
  • Hikashop Business
5 months 1 week 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: 12208
  • Thank you received: 1685
  • MODERATOR
5 months 1 week 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.057 seconds
Powered by Kunena Forum