Sorting Of Addresses in checkout

  • Posts: 200
  • Thank you received: 17
3 months 2 weeks 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 months 2 weeks ago by rodfarrell.

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

  • Posts: 67119
  • Thank you received: 9946
  • MODERATOR
3 months 2 weeks 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: 200
  • Thank you received: 17
3 months 2 weeks 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: 12170
  • Thank you received: 1677
  • MODERATOR
3 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.062 seconds
Powered by Kunena Forum