Пример #1
0
 /**
  * Sets the address location for calculating tax and shipping estimates
  *
  * @author Jonathan Davis
  * @since 1.1
  *
  * @param array $data New address data to update
  * @return void
  **/
 public function locate(array $data = null)
 {
     if ($data) {
         $this->updates($data);
     }
     if (empty($this->country)) {
         if (1 == count($markets)) {
             // If the target markets are set to single country,
             $this->country = key($markets);
         } else {
             $this->country = ShoppBaseLocale()->country();
         }
         // base of operations
     }
     $Locale = new ShoppLocale($this->country);
     $this->region = $Locale->region();
     // Update state if the postcode exists for tax updates
     if (isset($this->postcode)) {
         $this->postmap();
     }
 }