示例#1
0
 /**
  * Sets the destination array using either post, session or provided array
  * @param string $internal_name internal name of shipping module
  * @param array $dest optional array if you already know destination.
  */
 function set_destination($internal_name, $dest = FALSE)
 {
     if (!$dest) {
         $tools = new ASHTools();
         if (!array_key_exists("wpec_ash", $_SESSION)) {
             $_SESSION["wpec_ash"] = array();
         }
         $session_destination = array_key_exists($internal_name, $_SESSION["wpec_ash"]) ? $_SESSION["wpec_ash"][$internal_name]["shipment"]["destination"] : array();
         $this->destination = $tools->get_destination($session_destination);
     } else {
         $this->destination = $dest;
     }
 }
 /**
  * Sets the destination array using either post, session or provided array
  * @param string $internal_name internal name of shipping module
  * @param array $dest optional array if you already know destination.
  */
 function set_destination($internal_name, $dest = FALSE)
 {
     if (!$dest) {
         $tools = new ASHTools();
         $wpec_ash = wpsc_get_customer_meta('shipping_ash');
         if (!$wpec_ash) {
             $wpec_ash = array();
         }
         $session_destination = array_key_exists($internal_name, $wpec_ash) ? $wpec_ash[$internal_name]["shipment"]["destination"] : array();
         $this->destination = $tools->get_destination($session_destination);
     } else {
         $this->destination = $dest;
     }
 }