[Skip to main content](#vessel-content)

#   Sorting Of Addresses in checkout

##

- **[rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")**
- [![rodfarrell's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5859-rodfarrell "View rodfarrell's Profile") Topic Author
- [ Offline](/forum/user/5859-rodfarrell)

Less More

- Posts: 259
- Thank you received: 22
-
-

7 years 5 months ago -  7 years 5 months ago [\#308094](#308094) by [rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")  *[Sorting Of Addresses in checkout](/forum/27-checkout/897764-sorting-of-addresses-in-checkout#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&#95;select.php What changes are needed there or am I on the wrong track?")* was created by *[rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")*

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: 7 years 5 months ago by [rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5Nzc2NC1zb3J0aW5nLW9mLWFkZHJlc3Nlcy1pbi1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

7 years 5 months ago [\#308108](#308108) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Sorting Of Addresses in checkout](/forum/27-checkout/897764-sorting-of-addresses-in-checkout#308108 "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&#95;select.php What changes are needed there or am I on the wrong track?")*

Hi,

You would have to change the line: Code:

$query = 'SELECT a.* FROM '.hikashop_table('address').' AS a WHERE '.implode(' AND ', $filters).' ORDER BY a.address_default DESC, a.address_id DESC';

to: Code:

$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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5Nzc2NC1zb3J0aW5nLW9mLWFkZHJlc3Nlcy1pbi1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")**
- [![rodfarrell's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5859-rodfarrell "View rodfarrell's Profile") Topic Author
- [ Offline](/forum/user/5859-rodfarrell)

Less More

- Posts: 259
- Thank you received: 22
-
-

7 years 5 months ago [\#308196](#308196) by [rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")  Replied by *[rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")* on topic *[Sorting Of Addresses in checkout](/forum/27-checkout/897764-sorting-of-addresses-in-checkout#308196 "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&#95;select.php What changes are needed there or am I on the wrong track?")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5Nzc2NC1zb3J0aW5nLW9mLWFkZHJlc3Nlcy1pbi1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

7 years 4 months ago [\#308199](#308199) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Sorting Of Addresses in checkout](/forum/27-checkout/897764-sorting-of-addresses-in-checkout#308199 "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&#95;select.php What changes are needed there or am I on the wrong track?")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5Nzc2NC1zb3J0aW5nLW9mLWFkZHJlc3Nlcy1pbi1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.049 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
