OS Property support center

Search Properties Module Special hardcode...

  • Dycon
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 6 months ago #36733 by Dycon
Hello everyone,
I explain, in one of my last post I asked if it was possible so use a drop down select box instead of input box when using a custom field in the back end for search...

And the answer was that at the moment it was not possible that I had to do some coding on my own... so I did...

in the back end I have an input field for the agent to fill up for each property, that same input box is use in the search module, my understanding is that if you use an input box, then for the search is going to be the same... if I use a select box or a dropbox it will be the same in the search module, the point is, I've manage to have the input box of the back end as a drop box in the front end and it shows every single property with those values...

Now, here is the tricky part...


Lets pretend: ....

Agent log-in in back end to upload 3 new properties:

he fill up all the information and the custom input field with the following information:
Prop 1 input [ Lajas ]
Prop 2 input [ Joyas ]
Prop 3 input [ Lajas ]

Now in the front end in the search module it will show my dropdown box with those values as:
Please select a location:
[ Joya ]
[ Lajas ]
[ Lajas ]


as you can see it shows "Lajas" 2 time as per property, my questions are:

1.- How can I make it show only once if "Lajas" already exist the show it only once...

When a user selects one of the options it shows the property that belongs to that "value", the idea is to search for ALL properties with that value.

2.- How do I do that?

If I send that value directly to the link
index.php?option=com_osproperty&task=locator_default&ajax=1&keyword=Lajas

it shows 0 results although there are 2 properties...

the idea is to show every single property that contains that value...

the website is live, and I'll provide the link as per request....


Thank you.

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

More
10 years 6 months ago #36738 by Mr. Dam
Hi,
1. About the problem with many duplicate extra fields item in the dropdown select list of extra field at frontend. I think you need to have the php function to remove the duplicate value before add them into the dropdown list.
Step1: collect values of extra field and add them into one php array
Step2: before add value into php array, using function in_array of php to add the value that is unavailable in the array.
Step3: after above steps, you will have the array with unique values of extra field. Now you can add items of array into dropdown select list.
2. The locator search function doesn't search through the extra fields. Only advanced search function search through extra fields
Thanks
Dam

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

  • Dycon
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 6 months ago #36777 by Dycon
Hello, Thank you....

What I did was
1.- my result was not in an array, you may say it was in a live feed as per request kind of like using Ajax to fetch live information and updating the info right in the spot... So I switch it to an array that way I feel more secure, I should have done that before, thank you for pointing that out.

2.- in my sql query to I only added the DISTINCT before it was just SELECT now SELECT DISTINCT value FORM .... now I get all the listing without duplicating it... that works awesome!!!!!

Now here is the problem.


testing this changes locally it works fine, it list all properties that are using X word, it does matter if is new, old, special... whatever... it list all as expected, that is fine... but in the live site it only list the last property using X word... and I wonder why is that?

any thoughts on that?

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

Moderators: Mr. DamNguyen Phu Quan