Exemple #1
0
 private function appendTaxRateFieldValidator(LiveCartValidator $validator, DeliveryZone $zone, TaxClass $class = null)
 {
     $field = $this->getFieldName($zone, $class);
     $validator->addCheck($field, new IsNumericCheck($this->translate("_error_rate_should_be_numeric_value")));
     $validator->addCheck($field, new MinValueCheck($this->translate("_error_rate_should_be_greater_than_zero"), 0));
     $validator->addFilter($field, new NumericFilter());
 }
Exemple #2
0
 protected function getValidator($validatorName, Request $request = null)
 {
     $validator = new LiveCartValidator($validatorName, $request ? $request : $this->request);
     $validator->setApplication($this->application);
     return $validator;
 }