/** * @return RequestValidator */ private function buildCartValidator(CustomerOrder $order, $options) { unset($_SESSION['optionError']); $validator = $this->getValidator("cartValidator", $this->request); foreach ($order->getOrderedItems() as $item) { $this->buildItemValidation($validator, $item, $options, $item->getID()); } if ($this->config->get('CHECKOUT_CUSTOM_FIELDS') == 'CART_PAGE') { $order->getSpecification()->setValidation($validator, true); } if ($this->isTosInCartPage()) { $validator->addCheck('tos', new IsNotEmptyCheck($this->translate('_err_agree_to_tos'))); } return $validator; }
/** * @return RequestValidator */ private function createFieldsFormValidator(CustomerOrder $order) { $validator = $this->getValidator("CustomerOrderFields", $this->request); $order->getSpecification()->setValidation($validator); return $validator; }