Beispiel #1
0
 /**
  * Carrier step
  */
 protected function processCarrier()
 {
     global $orderTotal;
     parent::_processCarrier();
     if (count($this->errors)) {
         $this->context->smarty->assign('errors', $this->errors);
         $this->_assignCarrier();
         $this->step = 2;
         $this->displayContent();
         include dirname(__FILE__) . '/../footer.php';
         exit;
     }
     $orderTotal = $this->context->cart->getOrderTotal();
 }
 /**
  * Carrier step
  */
 protected function processCarrier()
 {
     global $orderTotal;
     parent::_processCarrier();
     if (count($this->errors)) {
         $this->context->smarty->assign('errors', $this->errors);
         $this->_assignCarrier();
         $this->step = 2;
         $this->displayContent();
     }
     $orderTotal = $this->context->cart->getOrderTotal();
 }
 /**
  * Carrier step
  */
 protected function processCarrier()
 {
     // die('123');
     global $orderTotal;
     parent::_processCarrier();
     if ($_POST['delivery_form'] == 1) {
         if (empty($_POST['city'])) {
             $this->errors[] = Tools::displayError('Город обязателен');
         }
         if (empty($_POST['street'])) {
             $this->errors[] = Tools::displayError('Улица обязательна');
         }
         if (empty($_POST['house'])) {
             $this->errors[] = Tools::displayError('Дом обязателен');
         }
         $address = new Address($this->context->cart->id_address_delivery);
         if (!count($this->errors) && is_object($address) && isset($address->id_customer)) {
             $address->city = $_POST['city'];
             $address->address1 = $_POST['city'] . ' ' . $_POST['street'] . ' ' . $_POST['house'] . ' ' . $_POST['corpus'] . ' ' . $_POST['apartment'];
             $delivery_pickup = array('delivery_city' => $_POST['city'], 'delivery_street' => $_POST['street'], 'delivery_house' => $_POST['house'], 'delivery_corpus' => $_POST['corpus'], 'delivery_apartment' => $_POST['apartment'], 'delivery_date' => isset($_POST['date_dilivery']) ? $_POST['date_dilivery'] : '');
             foreach ($delivery_pickup as $k => $v) {
                 $this->context->cookie->{$k} = $v;
             }
             $address->save();
         } else {
             $this->errors[] = Tools::displayError('Невозможно загрузить адресс');
         }
     }
     if (count($this->errors)) {
         $this->context->smarty->assign('errors', $this->errors);
         $this->_assignCarrier();
         $this->step = 2;
         $this->initContent();
     } else {
         $this->step = 3;
         $orderTotal = $this->context->cart->getOrderTotal();
     }
 }