public function setData(Order $order, array $data)
 {
     $option = null;
     if (isset($data['ShippingMethodID'])) {
         $option = ShippingMethod::get()->byID((int) $data['ShippingMethodID']);
     }
     //assign option to order / modifier
     if ($option) {
         $order->setShippingMethod($option);
         Session::set("Checkout.ShippingMethod", $option);
     }
 }
 function setShippingMethod($data, $form)
 {
     $order = $this->owner->Cart();
     $option = null;
     if (isset($data['ShippingMethodID'])) {
         $option = ShippingMethod::get()->byID((int) $data['ShippingMethodID']);
     }
     //assign option to order / modifier
     if ($option) {
         $order->setShippingMethod($option);
     }
     $this->owner->redirect($this->NextStepLink());
 }
 /**
  * get options that apply to package and location
  */
 function getShippingMethods()
 {
     //TODO: restrict options to region / package specs
     return ShippingMethod::get()->filter("Enabled", 1);
 }