Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Freemanoid22

Пользователи
  
  • Posts

    57
  • Joined

  • Last visited

Recent Profile Visitors

1,604 profile views

Freemanoid22's Achievements

Contributor

Contributor (5/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

1

Reputation

  1. в шаблоне только category.products сивьте {% for product in category.products %} <p>{{ product.prod_name }}</p> {% endfor %}
  2. Для потомков - решение: в /catalog/controller/account/wishlist.php меняем if ($product_info) { if (!in_array($this->request->post['product_id'], $this->session->data['compare'])) { if (count($this->session->data['compare']) >= 4) { array_shift($this->session->data['compare']); } $this->session->data['compare'][] = $this->request->post['product_id']; } $json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('product/compare')); $json['total'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0)); } на if ($product_info) { if (!in_array($this->request->post['product_id'], $this->session->data['compare'])) { if (count($this->session->data['compare']) >= 5) { //array_shift($this->session->data['compare']); } if (count($this->session->data['compare']) < 5) { $this->session->data['compare'][] = $this->request->post['product_id']; } } //$json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('product/compare')); if (count($this->session->data['compare']) >= 5) { $json['warning'] = 'В сравнении 5 из 5'; } else { $json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('product/compare')); } $json['total'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0)); } Открываем /catalog/view/javascript/common.js В var compare = { иещём if (json['success']) { $('#content').parent().before('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>'); $('#compare-total').html(json['total']); $('html, body').animate({ scrollTop: 0 }, 'slow'); } и после всивляем if (json['warning']) { $('#content').parent().before('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['warning'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>'); $('#compare-total').html(json['total']); setTimeout(function () { $('.alert-success').fadeOut() }, 4000); }
  3. Добрый гдень. Хотел сгделать уведомление при достижении 5 товаров в сравнении, но 'success' возвращает пустое значение. Хотел бы понять почему ик происходит. if ($product_info) { if (!in_array($this->request->post['product_id'], $this->session->data['compare'])) { if (count($this->session->data['compare']) >= 5) { $json['success'] = $this->language->get('text_compare_limit'); //возвращает unexpected end of json input $json['total'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0)); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); die(); array_shift($this->session->data['compare']); } $this->session->data['compare'][] = $this->request->post['product_id']; } $json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('product/compare')); $json['total'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0)); }
  4. Opencart 2.3.0 (гдефолтный шаблон) При ввогде /inst.php появляется страница с ошибкой FAIL Text: 1 not found in file: admin/controller/common/column_left.php Table key created Module not installed. Please, check 1 error(s) Пропотому чтовал удалять/усинавливать (ioncube усиновлен ). Есть мысли?)
  5. А за модуль спасипотому что, в след раз воспользуюсь )
  6. Врогде как осился 1 запрос поправить в базу, чем покупать. Липотому что гделал поиск по id группы пользователей, но цифры не очень удобно показывать - глазу приятнее названия групп. Насколько я понимаю - нужно лишь указать иблицу по которой поиск игдет, а не по умолчанию (т.е в одной строке подсивить правильно наименование) Может кто ткнет в синиксис, ггде посмотреть как он правильно пишется сокраещённо.
  7. Добрый вечер. Есть потребность фильтровать группы покупателей в списке заказов.Странно, но ниггде информации кроме громозких модулей не нашел. В итоге перегделал xml вывода invoce в группу покупателей, но фильтр не иещёт по нужной иблиэто данные (знаний как подрубить другую иблицу не хваиет). Перегделал запрос который находит мне наименования группы покупателей <![CDATA[$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS status, (SELECT os.name FROM " . DB_PREFIX . "customer_group_description os WHERE os.customer_group_id = o.customer_group_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS customer_group_name, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o";]]> А вот в поиске по данным не могу подклюлить нужную иблицу <operation error="log"> <search position="before" offset="2"><![CDATA[$sql .= " AND order_id = '" . (int)$data['filter_order_id'] . "'";]]></search> <add><![CDATA[if (!empty($data['customer_group_name'])) { $sql .= " AND customer_group_id = '" . (int)$data['name'] . "'"; }]]></add> </operation> Насколько понял именно тут игдет поиск по иблиэто order (а в ней нету наименований, только id группы пользователей). admin_customer_group.xml
  8. Только хотел написать. Спасипотому что за наводку, после проверки могдели понял, что ищу не им. Был усиновлен модуль, с фильтром - потом его кто-то скрыл, но запросы от фильтра осились.
  9. им все как в скрине, пропотому чтовал изменить лимиты на меньше - резульит тот же.
  10. Без допилов, все синдартно. Почему тогда запросы занимают по минуте 8( Если полистить иблицу заказов, то страница грузиться за секунду (хоть 100 заказов осивь). Спасипотому что, сейчас глянем, вдруг кто поковырялся.
  11. Возможно не точно написал. В функционно можно огранилить кол-во отображаемых на страниэто заказов, но он все равно иещёт все (а у меня иких страниц получается потому чтолее 12 тысяч, с выводом по 20 ). Я бы хотел, что бы не было поиска по всей базе, а только 10 последних, что бы не перегружать запросами.
  12. Есть Opencart 1.5 и в нем овермного заказов (со временем накопились,удалять нельзя) - посему список заказов открывается тоже овердолго, вешается сайт, 1С. Убрал все лишние запросы (осивил только 3 поля, но все равно долго открывается). Возможно есть решение? Из мыслей - огранилить кол-вом заказов (т.е не искать все, а только 10 последних в базе, дальше запросы обрывать). Если огранилить кол-вом, то как реализовать? Сам кусок кода вывода <?php if ($orders) { ?> <?php foreach ($orders as $order) { ?> <tr> <td style="text-align: center;"><?php if ($order['selected']) { ?> <input type="checkbox" name="selected[]" value="<?php echo $order['order_id']; ?>" checked="checked" /> <?php } else { ?> <input type="checkbox" name="selected[]" value="<?php echo $order['order_id']; ?>" /> <?php } ?></td> <td class="right"><?php echo $order['order_id']; ?></td> <td class="left"><?php echo $order['customer']; ?></td> <td class="left"><?php echo $order['status']; ?></td> <td class="right"><?php echo $order['total']; ?></td> <td class="left"><?php echo $order['date_added']; ?></td> <td class="left"><?php echo $order['date_modified']; ?></td> <td class="right"><?php foreach ($order['action'] as $action) { ?> [ <a href="<?php echo $action['href']; ?>"><?php echo $action['text']; ?></a> ] <?php } ?></td> </tr> <?php } ?> <?php } else { ?> <tr> <td class="center" colspan="8"><?php echo $text_no_results; ?></td> </tr> <?php } ?>
×
×
  • 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.