My products contain attributes called zipcode and city. The goal of the custom search functionality I’m attempting to add is for the search to perform a special db query where it will return all products within a given mile radius of the entered city or state. I currently have the database of zipcodes, cities and lat/long coordinates + the query necessary to return the appropriate zip codes/cities in the given mile radius.
Where I’m stuck is in an attempt to extend the current search functionality to support a unique query that will return an array of zipcodes, then find all the products with it’s zipcode attribute matching one of the zip codes in the query result.
I’m not 100% sure where to begin with extending the search. My first thought was to create an additional controller, however I haven’t yet extended a controller before. I have some experience with the general model and should be able to get around with some direction.
If anyone could run through how they would extend search to perform this unique query against a stored procedure taking the resulting zip codes and find products who’s attributes match those values.
Currently I’ve created the following:
Should result.php extend the original result or would it be best to extend front_end and create a new controller? Does this sound like the right direction at all?
Thanks in advance for your help.