Exemplo n.º 1
0
 public function getShippingMethodType()
 {
     return ShippingMethodType::getByID($this->smtID);
 }
Exemplo n.º 2
0
 public function validate($data)
 {
     $this->error = null;
     $e = Loader::helper('validation/error');
     //check our manditory fields
     if ($data['methodName'] == "") {
         $e->add(t("Method Name must be set"));
     }
     if (!is_numeric($data['minimumAmount'])) {
         $e->add(t("Minimum Amount must be numeric"));
     }
     if (!is_numeric($data['maximumAmount'])) {
         $e->add(t("Maximum Amount must be numeric"));
     }
     //pass the validator to the shipping method to check for it's own errors
     $shippingMethodType = ShippingMethodType::getByID($data['shippingMethodTypeID']);
     $e = $shippingMethodType->getMethodTypeController()->validate($data, $e);
     return $e;
 }