コード例 #1
0
 public function testIsCountryInEU()
 {
     $this->scopeConfig->expects($this->exactly(2))->method('getValue')->with('general/country/eu_countries', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)->will($this->returnValue("GB"));
     $this->assertEquals(true, $this->helper->isCountryInEU("GB"));
     $this->assertEquals(false, $this->helper->isCountryInEU("US"));
 }
コード例 #2
0
ファイル: Carrier.php プロジェクト: IlyaGluschenko/protection
 /**
  * Check if shipping is domestic
  *
  * @param string $origCountryCode
  * @param string $destCountryCode
  * @return bool
  */
 protected function _checkDomesticStatus($origCountryCode, $destCountryCode)
 {
     $this->_isDomestic = false;
     $origCountry = (string) $this->getCountryParams($origCountryCode)->getData('name');
     $destCountry = (string) $this->getCountryParams($destCountryCode)->getData('name');
     $isDomestic = (string) $this->getCountryParams($destCountryCode)->getData('domestic');
     if ($origCountry == $destCountry && $isDomestic || $this->_carrierHelper->isCountryInEU($origCountryCode) && $this->_carrierHelper->isCountryInEU($destCountryCode)) {
         $this->_isDomestic = true;
     }
     return $this->_isDomestic;
 }