jds43 Posted November 23, 2021 Share Posted November 23, 2021 Hello, I'm using an API to return a collection of zip codes within a radius of a particular zip code the user will input. These will populate a list of locations, but I'm having trouble promoting the zip code input by the user to the top of the list. Sort isn't working at all. ZIP is the location page zip code field.$city_or_zipcode is the sanitized input.$selector is the decoded JSON response as string for zip codes separated by pipes. $producers = $locations->children("(ZIP=$city_or_zipcode), (ZIP=$selector), template=producer, limit=24"); I've even prepended the searched user zip code to $selector and it doesn't help either. Any ideas? Link to comment Share on other sites More sharing options...
jds43 Posted November 24, 2021 Author Share Posted November 24, 2021 Ended up removing the searched user zip code from the $selector response and opted not to paginate. Hopefully it's good enough. $target = $pages->find("ZIP=$city_or_zipcode, template=producer"); $range = $find_help->children("ZIP=$selector"); $producers = $target->add($range->find("limit=24")); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now