diff --git a/www/override/controllers/front/OrderController.php b/www/override/controllers/front/OrderController.php index 2e8ecc41..58ceb605 100644 --- a/www/override/controllers/front/OrderController.php +++ b/www/override/controllers/front/OrderController.php @@ -114,24 +114,35 @@ class OrderController extends OrderControllerCore $echantillons = false; if ($this->nbProducts == 1) { - $products = $this->context->cart->getProducts(); - foreach($products as $p) { - if ($p['id_product'] == 193) { - $echantillons = true; - } - } + $products = $this->context->cart->getProducts(); + foreach($products as $p) { + if ($p['id_product'] == 193) { + $echantillons = true; + } + } } + if (empty(Tools::getValue('date-carrier')) && $echantillons == false) { Tools::redirect('index.php?controller=order&step=1'); } - if(Tools::isSubmit('processAddress')) + if(Tools::isSubmit('processAddress')) { $this->processAddress(); - - if (Tools::isSubmit('processCarrier')) { - $this->_updateMessage(Tools::getValue('message')); - } - + } + + $message = "Je vous prie de me livrer le ".Tools::getValue('date-carrier'); + $realMessage = Tools::getValue('message', ''); + $message.= (empty($realMessage) ? '' : " ".$realMessage); + $this->_updateMessage($message); + + /*if (Tools::isSubmit('processCarrier')) { + $message = "Je vous prie de me livrer le ".Tools::getValue('date-carrier'); + $realMessage = Tools::getValue('message', ''); + $message.= (empty($realMessage) ? '' : $realMessage); + echo " - ".$message; + $this->_updateMessage($message); + }*/ + if ($know = strtolower(Tools::getValue('howknowus'))) { if (!empty($know)) { $id_customer = $this->context->customer->id; diff --git a/www/themes/chocolatdemariage/order-carrier.tpl b/www/themes/chocolatdemariage/order-carrier.tpl index 34d4a0ba..43c3982b 100644 --- a/www/themes/chocolatdemariage/order-carrier.tpl +++ b/www/themes/chocolatdemariage/order-carrier.tpl @@ -206,12 +206,7 @@ $(function() { } else { return [true, '']; } - }}); - //$('#date-carrier').datepicker({dateFormat: "dd/mm/yy"}); - $('#date-carrier').change(function(){ - var dateVal = $('#date-carrier').val(); - $('#ordermsg .form-control').val(dateSentence + dateVal); - }); + }}); }); {/literal}