Closed Mike-Heneghan closed 5 years ago
To stop users being confused with the "first location" not being nearby then don't display them.
Then check if the searched postcode and the postcode of the location matches then we have that at the top.
Create a template tag to handle the logic.
Pass in a collection of locations as well as the searched postcode.
Template tag will iterate check for matching postcode.
A further step will be to split the postcode district by the space.
Ideal result:
Created a service with multiple locations and entered in a way that the Aberdeen location was saved first.
The Aberdeen location is consistently the first one.
To do list:
[x] Create a template tag which takes in a collection of locations and the postcode to check for a match with the searched postcodes.
[x] If there is a postcode district match then have it as the first location.
[x] Else don't display the search results.
To do list:
Was going to quickly update the PR with changes to master but noticed that when a service has a single location is the location isn't in the same postcode district it doesn't appear. I'm not sure whether this is the desired behaviour.
Merged and a new PR to change behaviour.
If a service has more than one location when it appears in the search results the link to that location may not be the closest one for the user.
Need to resolve this by changing the way the locations are displayed.