Esempio n. 1
0
 /**
  * Return the shop country
  *
  * @throws LogicException if no shop country is defined
  */
 public static function getShopLocation()
 {
     $countryId = ConfigQuery::getStoreCountry();
     // return the default country if no shop country defined
     if (empty($countryId)) {
         return self::getDefaultCountry();
     }
     $shopCountry = CountryQuery::create()->findPk($countryId);
     if ($shopCountry === null) {
         throw new \LogicException(Translator::getInstance()->trans("Cannot find the shop country. Please select a shop country."));
     }
     return $shopCountry;
 }