diff --git a/packages/Webkul/Core/src/Core.php b/packages/Webkul/Core/src/Core.php index 9f75c789e..d82f557ef 100755 --- a/packages/Webkul/Core/src/Core.php +++ b/packages/Webkul/Core/src/Core.php @@ -591,6 +591,24 @@ class Core return $collection; } + /** + * Retrieve all grouped states by country code + * + * @return Collection + */ + public function findStateByCountryCode($countryCode = null, $stateCode = null) + { + $collection = array(); + + $collection = $this->countryStateRepository->findByField(['country_code' => $countryCode, 'code' => $stateCode]); + + if(count($collection)) { + return $collection->first(); + } else { + return false; + } + } + /** * Returns time intervals *