Help - Search - Members - Calendar
Full Version: Adding Products to Search
User Forums > Ultimate Locator v1 - v2.5 Support > General Support
fullcircleconsulting
I'm installing Ultimate Locator for a customer who wants to use the service to locate stores throughout the country. Easily done. But this customer's stores carry different products. So he also wants his customers to be able to search for specific products, and find the closest store carrying that product. Does Ultimate Locator provide this additional functionality?
Brian
Yes, this type of function is supported, to a degree.

You can use a user field to hold product info. Such as product names. Like this: Ketchup

You can then add a drop down menu to your index.htm template that reflect these same values, where a user can select from Ketchup, Mustard or Mayonnaise.

The locations that get returned as a match will be the locations that have the text Ketchup in the user1 field.

However, if a store carries multiple products, then you will enter the product info into the user1 field like this: Ketchup Mustard Mayonnaise Pickles

And you will have to change the code in the results_list.php file to perform a 'like' query instead of an exact match query. Changing the code only takes a few seconds and is very easy to do.

This way, when a user searches on zip code 90210 and a product choice of Mustard, the query will return any record that has a like instance of the text Mustard.

There is more info in the user manual on how to implement user field searching.

Hope this helps!
genero
We've got a similar issue with our implementation and have a few follow up questions.

In addition to a product field, we've also got a field for "retailer type". Each field has 12 and 7 values respectively and each entry can have more than one value for the two fields. We were thinking of combining these entries into two user fields but were wondering if we could create fields for each type of product and retailer (effectively creating 19 custom fields). The reason being is that our client exports this data directly from their CRM app and we've already created a custom report that spits out the data in the correct format for Ultimate Locator. Also, the client will never use the web interface to change individual entries - all changes will be done via a bulk upload. Because of this, the client will "massage" the data before the upload and concatenating the data into two fields will undoubtedly lead to errors.

Our lead developer has been working with the Ultimate Locator software for about 3 months now and has become quite familiar with the code. He was working on implementing these changes to the app and database but discovered that the source for this particular file is encrypted. Can we make changes to the file or is this in violation with the licensing agreement?
Brian
Genero,

It would be hard to add additional fields to any Ultimate Locator system, because your admin control panel files are encoded and you can not directly edit the php code. If you add 20 more user fields to your location table, then your admin panel files will not be aware of these 20 additional fields and woudl not work or use them.

If you are needing full source code for all files of our system, we do offer a Developer's License, but the cost for this license is hundreds more. If you are interested, just email support and ask for more info on a Developer's License.

On the other hand, if you do not use the admin panel to add/edit/view/approve pending locations in your database, technically you could add more fields and have your front-end coded to be aware of the fields.
dmstickman
QUOTE(Brian @ Feb 8 2006, 06:30 PM) *
However, if a store carries multiple products, then you will enter the product info into the user1 field like this: Ketchup Mustard Mayonnaise Pickles

And you will have to change the code in the results_list.php file to perform a 'like' query instead of an exact match query. Changing the code only takes a few seconds and is very easy to do.


Can you give me the specifics of changing the code in the results_list.php file? I have multiple products listed in the user1 field, and I would like to be able to do a search for stores in an area that carry a certain product.

I have made a drop down list in the form for the user to use to select the product that they want. I just need to change it to a 'like' search instead of an equal.

Any help is appreciated.
Brian
Inside the results_list.php page, you will find the following line of code in several places:

CODE
if($user1!="")        { $query = $query."and user1='$user1' ";        }


That line is setup for exact match searching. To change it to LIKE searching, edit the line so it looks like:

CODE
if($user1!="")        { $query = $query."and user1 LIKE '$user1' ";        }


Now, the line can be found in many different places within the page. Basically, once for each search type. You will find it in the Zip Code search area, the City Name search area, etc... Change it in any of them if you want that type of search to be LIKE searching on the user field.

Now, ther are a total of five user fields, so you can change any or all of them to LIKE searching. You will see the same line of code for each of the user fields. User1, User2, etc...
dmstickman
QUOTE(Brian @ Jul 17 2006, 02:51 PM) *
Inside the results_list.php page, you will find the following line of code in several places:

CODE
if($user1!="")        { $query = $query."and user1='$user1' ";        }


That line is setup for exact match searching. To change it to LIKE searching, edit the line so it looks like:

CODE
if($user1!="")        { $query = $query."and user1 LIKE '$user1' ";        }


Now, the line can be found in many different places within the page. Basically, once for each search type. You will find it in the Zip Code search area, the City Name search area, etc... Change it in any of them if you want that type of search to be LIKE searching on the user field.

Now, ther are a total of five user fields, so you can change any or all of them to LIKE searching. You will see the same line of code for each of the user fields. User1, User2, etc...


Thanks for the quick reply, Brian. One more question....

I have inserted 2 checkboxes in the search form. I did it just like the manual, and they seem to function. They look for a yes answer in user2 and user3 fields. HOWEVER, if neither box is checked, I get a result that no matches are found. How do I make it return all matches within the area if neither is checked, but only the corresponding matches if a box is checked?
dmstickman
[/quote]

Thanks for the quick reply, Brian. One more question....

I have inserted 2 checkboxes in the search form. I did it just like the manual, and they seem to function. They look for a yes answer in user2 and user3 fields. HOWEVER, if neither box is checked, I get a result that no matches are found. How do I make it return all matches within the area if neither is checked, but only the corresponding matches if a box is checked?
[/quote]


I have found that if i take out my drop down product list for user1, then my user2 and user3 checkboxes work correctly. I get all results when nothing is checked, and get just the appropriate results when a box is checked.

But when my drop down list is there, I get no results with no checks, and I get appropriate results when an item is checked.

Does this make any sense? I obviously have something incorrect in my drop down or my "LIKE" statement.
Brian
QUOTE(dmstickman @ Jul 17 2006, 01:58 PM) *
Thanks for the quick reply, Brian. One more question....

I have inserted 2 checkboxes in the search form. I did it just like the manual, and they seem to function. They look for a yes answer in user2 and user3 fields. HOWEVER, if neither box is checked, I get a result that no matches are found. How do I make it return all matches within the area if neither is checked, but only the corresponding matches if a box is checked?


dmstickman,

Can you copy and paste your 3 different URLs that get posted after a search? One for each instance.

1. No checkboxes
2. With one Checkbox
3. With the other Checkbox

Let's anlyze what variables are being sent over to your results_list.php page.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.