Initial commit

This commit is contained in:
2020-01-27 08:56:08 +01:00
commit b7525048d6
27129 changed files with 3409855 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<?php
namespace OrderComment\Controller;
use Front\Front;
use OrderComment\Form\CommentForm;
use Propel\Runtime\Exception\PropelException;
use Thelia\Controller\Front\BaseFrontController;
use Thelia\Core\Translation\Translator;
use Thelia\Form\Exception\FormValidationException;
/**
* Class OrderCommentController
* @package OrderComment\Controller
*/
class OrderCommentController extends BaseFrontController
{
public function setComment()
{
$message = false;
$commentForm = new CommentForm($this->getRequest());
try {
$form = $this->validateForm($commentForm);
$data = $form->getData($form);
$comment = $data['comment'];
if ($comment != null) {
$this->getRequest()->getSession()->set('order-comment', $comment);
}
return $this->generateRedirectFromRoute("order.delivery");
} catch (FormValidationException $e) {
$message = Translator::getInstance()->trans("Please check your input: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN);
} catch (PropelException $e) {
$this->getParserContext()->setGeneralError($e->getMessage());
} catch (\Exception $e) {
$message = Translator::getInstance()->trans("Sorry, an error occurred: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN);
}
if ($message !== false) {
$commentForm->setErrorMessage($message);
$this->getParserContext()
->addForm($commentForm)
->setGeneralError($message)
;
return $this->generateRedirectFromRoute("cart.view");
}
}
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="OrderCommentController.php" server="51.254.220.106//web/" local="131351948400000000" remote="131351948400000000" />
</dwsync>