OS Property support center

SOLVED !!! Sorting properties

  • Stephen
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
7 years 9 months ago - 7 years 9 months ago #100840 by Stephen
SOLVED !!! Sorting properties was created by Stephen
Hi
I have a question about sorting properties.

In the menu item ( Property listing layout) there is a dropdown about sorting properties (under the tab "other settings").
You have the ability to sort properties by feturerd properties and random propertis. This works independently of each other.
Fetured shows the featured properties on top, but all other properties shows up in the same order.
Random shows all properties in a random order, even the one with featured status (they are not on top).

My dilemma is that I would like to sort the properties with fetured properties on top and the non featured properties randomly.
This is because no properties would have a benefit over another because of name etc. (and thoose who have featured status should always be on top).

Q. Is there a way to have all properties sorted in a random way with featured properties on top?
If not, is there a way to implement this to the component. (Random sorting with featured status on top).

If the problem can be solved why worry? If the problem can not be solved, worrying will do you no good.
Last edit: 7 years 9 months ago by Mr. Dam.

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

More
7 years 9 months ago #100883 by Mr. Dam
Replied by Mr. Dam on topic Sorting properties
Hi,
You can try this solution. Please open file:
root > components > com_osproperty > classes > listing.php
Find:
Code:
$query .= " GROUP BY a.id ORDER BY $orderby $ordertype";
and change to
Code:
$query .= " GROUP BY a.id ORDER BY $orderby $ordertype, rand()";

I hope that solution will work with you
Thanks
Dam

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

  • Stephen
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
7 years 9 months ago #100925 by Stephen
Replied by Stephen on topic [SOLVED] Sorting properties
Hi

Thank you so much.
It seems to be working perfectly well

If the problem can be solved why worry? If the problem can not be solved, worrying will do you no good.

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

More
7 years 9 months ago #100964 by silvia
Replied by silvia on topic Sorting properties
Hallo, this is very good feature, what about if i need order by Featured first and latest property add? Thank you

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

Moderators: Mr. DamNguyen Phu Quan