diff --git a/language/en/default.php b/language/en/default.php index d424111..13dfbcf 100644 --- a/language/en/default.php +++ b/language/en/default.php @@ -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', diff --git a/traits/SearchesNearby.php b/traits/SearchesNearby.php index 42d5b5f..140e8ce 100644 --- a/traits/SearchesNearby.php +++ b/traits/SearchesNearby.php @@ -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;