/** * processes a form and * adds product question answer(s) to order item. * The answers are added as HTML and JSON * and redirects back to the previous page or a set BackURL * (set in the form data) * @param Array $data - form data * @param Form form - data from the form */ function addproductquestionsanswer($data, $form) { $this->getProductQuestionOrderItem(); $data = Convert::raw2sql($data); if ($this->productQuestionOrderItem) { $this->productQuestionOrderItem->updateOrderItemWithProductAnswers($answers = $data["ProductQuestions"], $write = true); } if (isset($data["BackURL"])) { $this->owner->redirect($data["BackURL"]); } else { $this->owner->redirectBack(); } }