Limiting Map Results to List of wpsl_id's
-
Let me just first off extend my appreciation for this plugin. It is absolutely amazing.
I have a feeling that this may be able to be answered by someone other than the developer. I am not exactly a novice to PHP, so I’m struggling. I’ve spent about four hours trying to figure out what I’m doing wrong…
Here is my goal — use a GET variable to modify the select statement that pulls the stores for the map
I’m under the presumption that the query to pull the stores for the map is in plugins/wp-store-locator/frontend/wpsl-ajax-functions.php starting at line 49.
In the query, where it says ‘WHERE active = 1’, I want to add in a variable that I’ve modified so that it only pull stores of a certain wpsl_id.
For some reason, no matter what I do, I cannot pull $_GET[‘stores’] and add it into the query. It’s as if it does not see the GET variable.
Ex. This (and a number of variants) does not work —
“SELECT *, ( $distance_unit * acos( cos( radians( %s ) ) * cos( radians( lat ) ) * cos( radians( lng ) – radians( %s ) ) + sin( radians( %s ) ) * sin( radians( lat ) ) ) )
AS distance FROM $wpdb->wpsl_stores WHERE active = 1 && wpsl_id = “. $_GET[‘stores’] .””What am I missing? I feel it’s something trivial. Also, the variable is getting passed to the script. I can echo it near the beginning (but not from within the wpsl_store_search function).
Any help would be much appreciated.
Thanks!
- The topic ‘Limiting Map Results to List of wpsl_id's’ is closed to new replies.