OS Property support center

Change price filter dropdown in quick search modul

  • Stefano
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 8 months ago #47800 by Stefano
Hello!

I have two types of property category: "For Sale" and "For Rent".

I would like to display in Quick Search Module a different dropdown based on the value of category dropdown on the same module.

So I've already set prices for different categories in backend, but in front-end the result is that prices filter is not loaded at all, I mean, it is loaded the label and the dropdown, but I don't have any content.

Any suggestion to solve this big problem?

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

More
9 years 8 months ago #47804 by Mr. Dam
Hi Stefano,
I am understand you idea but currently the Quicksearch module doesn't have Price ajax filtering. In future, we will find the solution to add Price Ajax filtering by Property type for all search modules.
Thanks
Dam

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

  • Stefano
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 8 months ago #47815 by Stefano
I can write a JS function to onChange event in category filter dropdown.

Or a good quick solution could be to load all elements and then apply a custom attribute when creating <option> element. The with jQuery get the content of the category dropdown and delete element with a specific custom attribute from price dropdown.

But the question is: where do you create this list? in which php file and function?

Thx

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

More
9 years 8 months ago #47834 by Mr. Dam
Hi,
You can check page: components > com_osproperty > classes > ajax.php
this code:
case "ajax_loadPriceListOption":
$property_type = JRequest::getInt('property_type',0);
echo HelperOspropertyCommon::generatePriceList($property_type,$price);
exit();
break;

is used to get the price list option by the property type
Thanks
Dam

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

  • Stefano
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 8 months ago #47849 by Stefano
Thanks! Next step:
Before changing option attributes in the dropdown list I have to solve a problem.

My price filter dropdown in the quick search module shows only a "-Any-" option. That happens since I've set price filter "For rent" or "For Sale" on price filter backend.
As you can understand it is not good, because I've to get all values and then assign to each value a custom attribute depending on its property_type...
So, I think I have to change something in the query or modify something to get the whole list.

I've tried to search in listing.php but I didn't fide the right code.

Can you suggest me a solution?

Thx

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

Moderators: Mr. DamNguyen Phu Quan