Skip to content

Commit

Permalink
Checks the user has entered a full address with street name
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com>
  • Loading branch information
sampoyigi committed Sep 24, 2022
1 parent 0a0762c commit 2a4950b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions language/en/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
'alert_no_search_setting' => 'Location Search By setting has not been specified.',
'alert_no_search_query' => 'Please type in a address or postcode to check if we can deliver to you.',
'alert_invalid_search_query' => 'We couldn\'t locate the entered address or postcode, please enter a valid address or postcode.',
'alert_missing_street_address' => 'Please enter your street address.',
'alert_no_found_restaurant' => 'We do not have any local restaurant near you.',
'alert_location_required' => 'No location found or selected',
'alert_order_type_required' => 'There\'s no active online ordering option for this location',
Expand Down
3 changes: 3 additions & 0 deletions traits/SearchesNearby.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ protected function handleGeocodeResponse($collection)
if (!$userLocation->hasCoordinates())
throw new ApplicationException(lang('igniter.local::default.alert_invalid_search_query'));

if (!$userLocation->getStreetName())
throw new ApplicationException(lang('igniter.local::default.alert_missing_street_address'));

Location::updateUserPosition($userLocation);

return $userLocation;
Expand Down

0 comments on commit 2a4950b

Please sign in to comment.