Пример #1
0
 /**
  * Checks whether the store is registered to collect taxes in the given zone.
  *
  * @param ZoneInterface $zone    The zone.
  * @param Context       $context The context containing store information.
  *
  * @return bool True if the store is registered to collect taxes in the
  *              given zone, false otherwise.
  */
 protected function checkStoreRegistration(ZoneInterface $zone, Context $context)
 {
     $storeRegistrations = $context->getStoreRegistrations();
     foreach ($storeRegistrations as $country) {
         if (!isset($this->emptyAddresses[$country])) {
             $this->emptyAddresses[$country] = new Address($country);
         }
         if ($zone->match($this->emptyAddresses[$country])) {
             return true;
         }
     }
     return false;
 }
 /**
  * {@inheritdoc}
  */
 public function match(AddressInterface $address)
 {
     return $this->zone->match($address);
 }