예제 #1
0
 /**
  * Tools Methods
  *
  * Set country
  *
  **/
 public function getCountry()
 {
     // If eBay module has already been called once, use the default country
     if (!is_object($this->country)) {
         $this->country = new Country((int) Configuration::get('EBAY_COUNTRY_DEFAULT'));
     }
     // Else use PrestaShop Default country
     if (in_array(strtolower($this->country->iso_code), $this->acceptedIso)) {
         return $this->country;
     }
     $this->country = new Country((int) Configuration::get('PS_COUNTRY_DEFAULT'));
     if (in_array(strtolower($this->country->iso_code), $this->acceptedIso)) {
         Ebay::setConfigurationStatic('EBAY_COUNTRY_DEFAULT', $this->country->id);
         return $this->country;
     }
     return $this->country;
 }