OS Property support center

Sort properties by number of bedrooms by default

More
11 years 5 months ago - 11 years 5 months ago #38598 by Tim
Hi

Can you give me some instructions which file I should edit to sort all property lists by the number of bedrooms (most first).

I have seen sorting/ordering information on this page but the options don't appear to be on the control panel...

Many Thanks
Tim Baker

Sorry I know this post should be in OS Property instead of Pre-Sales Questions, but not sure how to change it now I have saved it!
Last edit: 11 years 5 months ago by Tim.

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

More
11 years 5 months ago #38600 by Mr. Dam
Hi Tim,
You want to sort properties in the list of properties page by bedroom? Can you send me the url so i can check and let you know where can you make the modification.
Thanks
Dam

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

More
11 years 5 months ago #38601 by Tim
Hi Dam

One of the pages is www.metrostudentaccommodation.co.uk/university-locations/bath all the other pages are the same type.

Thank you so much
Tim Baker

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

More
11 years 5 months ago #38646 by Tim
Hi

If that page doesn't give you the info you need please let me know and I will try and find it.

Many thanks
Tim Baker

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

More
11 years 5 months ago #38670 by Mr. Dam
Hi Tim,
To order properties by bedrooms, please follow these steps.
1. Open file
components > com_osproperty > classes > listing.php
2. find
$query .= " ORDER BY a.isFeatured desc, $orderby $ordertype";
and replace it by
$query .= " ORDER BY a.bed_room "; //if you want to sort properties by bed room field from small -> high
or
$query .= " ORDER BY a.bed_room desc"; //if you want to sort properties by bed room field from high-> small
Thanks
Dam
The following user(s) said Thank You: Tim

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

More
11 years 2 months ago #42477 by RIchard Ware
Replied by RIchard Ware on topic Sort properties by number of bedrooms by default
Hi Dang

Sorry to hijack a thread but I want to do almost the same as this but instead of order by number of bedrooms I want to order by 'Region'
Could you tell me how to change the code to achieve this?

I'm using the latest 2.6 version. Many Thanks

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

More
11 years 2 months ago #42479 by Mr. Dam
Hi Richard,
You mean the State/ Province or Region field of properties?
Thanks
Dam

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

More
11 years 2 months ago #42481 by RIchard Ware
Replied by RIchard Ware on topic Sort properties by number of bedrooms by default
Hi Dang

The 'Region' field if its possible?

Thanks

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

More
11 years 2 months ago #42551 by RIchard Ware
Replied by RIchard Ware on topic Sort properties by number of bedrooms by default
Hi there
Sorry to bother you, just wondering if you've had any time to sort my code so that I can sort by 'Region'?

Many thanks

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

More
11 years 2 months ago #42578 by Mr. Dam
Hi,
In database table : #__osrs_properties. There is the column: region. So you can change
$query .= " ORDER BY a.bed_room "; //if you want to sort properties by bed room field from small -> high
or
$query .= " ORDER BY a.bed_room desc"; //if you want to sort properties by bed room field from high-> small
by
$query .= " ORDER BY a.region "; //if you want region are sorted by aphabetic
or
$query .= " ORDER BY a.region desc";

Good luck
Dam
Thanks
Dam

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

Moderators: Mr. DamNguyen Phu Quan