Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Lenim

Newbie
  
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Lenim's Achievements

Rookie

Rookie (2/14)

  • First Post
  • Week One Done
  • One Month Later
  • One Year In
  • Conversation Starter

Recent Badges

0

Reputation

  1. Не нашел такой кнопки. Сейчас выполняется вот этот код, при заполнении всех полей формы (в cart.php) $this->db->query("INSERT INTO `" . DB_PREFIX . "order` SET firstname = '" . $this->db->escape($this->request->post['name']) . "', telephone = '" . $this->db->escape($this->request->post['phone']) . "', payment_method = '" . $this->db->escape($this->request->post['spoplata']) . "', email = '" . $this->db->escape($this->request->post['email']) . "', order_status_id = '1', comment = '" . $this->db->escape($this->request->post['comment']) . "', date_added = NOW(), date_modified = NOW()"); Как написать для общей суммы? total = ?
  2. При клике на "оформить заказ" в админ панели появляется два одинаковых заказа(вместо одного). В этих заказах имеются данные, которые ввел пользователь и даты заказа. Итоговая сумма = 0 руб, самих товаров и их кол-ва вообще нет. Не знаю, что делать. Рылся в логике php - в БД записываются данные из метода post. Мб подскажет кто как записать туда еще и такие данные как сам товар, кол-во и сумму. P.S. При клике на "в корзину" также добавляется 2 товара(вместо одного)
  3. также при просмотре заказа в шапке админ панели вылезает Notice: Undefined index: amazon_order_id in /home/a/andresik/j-web/public_html/admin/controller/sale/order.php on line 1539
  4. Может кто структуру файлов знает, подскажите что посмотреть
  5. Так же в просмотре заказа не выводятся товары
  6. SubTotal включен, полез в код и вот что обнаружил в cart.tpl : кнопка "оформить заказ" c id="oforzakaz" , кем-то написанные скрипты: $('#oforzakaz').bind('click', function() { $('.order_error').text(""); $.ajax({ url: 'index.php?route=checkout/cart/addorder', // Нужная нам строка type: 'post', data: $('#ofozak input[type=\'text\'],#ofozak select,#ofozak textarea'), dataType: 'json', success: function(json) { console.log(json); if(json['error']){ console.log("ERROR"); if(json['error']['name']){ $('#err_name').text(json['error']['name']); } if(json['error']['adres']){ $('#err_adres').text(json['error']['adres']); } if(json['error']['phone']){ $('#err_phone').text(json['error']['phone']); } }else{ }); Далее полез в cart.php искать метод addorder public function addorder() { $error =array(); $json = array(); if ((utf8_strlen($this->request->post['name']) < 1) || (utf8_strlen($this->request->post['name']) > 32)) { $error['name'] = "слишком короткое имя"; } if ((utf8_strlen($this->request->post['adres']) < 1) || (utf8_strlen($this->request->post['adres']) > 32)) { $error['adres'] = "введите адрес"; } if ((utf8_strlen($this->request->post['phone']) < 1) || (utf8_strlen($this->request->post['phone']) > 32)) { $error['phone'] = "неверный телефон"; } if(count($error)>0){ $json['error'] = $error; }else{ $this->db->query("INSERT INTO `" . DB_PREFIX . "order` SET firstname = '" . $this->db->escape($this->request->post['name']) . "', telephone = '" . $this->db->escape($this->request->post['phone']) . "', payment_method = '" . $this->db->escape($this->request->post['spoplata']) . "', shipping_address_1 = '" . $this->db->escape($this->request->post['spoplata']) . "', order_status_id = '1', comment = '" . $this->db->escape($this->request->post['comment']) . "', date_added = NOW(), date_modified = NOW()"); $json['succes'] = "номер заказа"; } $this->response->setOutput(json_encode($json)); } Как видно в БД не записывается цена и в ПОСТ методе её тоже нет , чтобы записывать (там только несколько переменных типа телефона, адреса, записываемых самим пользователем, при оформлении заказа) Посмотрел БД таблица order , total = "0" у всех заказов. Может подскажите как это можно пофиксить лучше всего?
Guest
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.