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

spk

Новичок
  
  • Posts

    15
  • Joined

  • Last visited

1 Follower

spk's Achievements

Apprentice

Apprentice (3/14)

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

Recent Badges

0

Reputation

  1. Начал перегделывать модуль под 1.4.7, но видимо не до конца разобрался. Врогде все полулилось, кроме контроллеров в catalog/ (см. скрин) <?phpclass ControllerCatalogPoll extends Controller { private $error = array(); public function index() { $this->load->language('catalog/poll'); $this->document->title = $this->language->get('heading_title'); $this->load->model('catalog/poll'); $this->getList(); } public function insert() { $this->load->language('catalog/poll'); $this->document->title = $this->language->get('heading_title'); $this->load->model('catalog/poll'); if (($this->request->server['REQUEST_METHOD'] == 'POST') && ($this->validateForm())) { $this->model_catalog_poll->addPoll($this->request->post); $this->session->data['success'] = $this->language->get('text_success'); $this->redirect(HTTPS_SERVER .'index.php?route=catalog/poll' . $url); } $this->getForm(); } public function update() { $this->load->language('catalog/poll'); $this->document->title = $this->language->get('heading_title'); $this->load->model('catalog/poll'); if (($this->request->server['REQUEST_METHOD'] == 'POST') && ($this->validateForm())) { $this->model_catalog_poll->editPoll($this->request->get['poll_id'], $this->request->post); $this->session->data['success'] = $this->language->get('text_success'); $this->redirect(HTTPS_SERVER .'index.php?route=catalog/poll' . $url); } $this->getForm(); } public function delete() { $this->load->language('catalog/poll'); $this->document->title = $this->language->get('heading_title'); $this->load->model('catalog/poll'); if ((isset($this->request->post['selected'])) && ($this->validateDelete())) { foreach ($this->request->post['selected'] as $poll_id) { $this->model_catalog_poll->deletePoll($poll_id); } $this->session->data['success'] = $this->language->get('text_success'); $this->redirect(HTTPS_SERVER .'index.php?route=catalog/poll' . $url); } $this->getList(); } private function getList() { $this->document->breadcrumbs = array(); $this->document->breadcrumbs[] = array( 'href' => HTTPS_SERVER . 'index.php?route=common/home', 'text' => $this->language->get('text_home'), 'separator' => FALSE ); $this->document->breadcrumbs[] = array( 'href' => HTTPS_SERVER . 'index.php?route=catalog/poll' . $url, 'text' => $this->language->get('heading_title'), 'separator' => ' :: ' ); $this->data['insert'] = HTTPS_SERVER . 'index.php?route=catalog/poll/insert' . $url; $this->data['delete'] = HTTPS_SERVER . 'index.php?route=catalog/poll/delete' . $url; $this->data['questions'] = array(); $results = $this->model_catalog_poll->getPolls(); foreach ($results as $result) { $action = array(); $action[] = array( 'text' => $this->language->get('text_edit'), 'href' => HTTPS_SERVER . 'index.php?route=catalog/poll/update&poll_id=' . $result['poll_id'] . $url ); $this->data['questions'][] = array( 'poll_id' => $result['poll_id'], 'question' => $result['question'], 'status' => ($result['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled')), 'active' => ($result['active'] ? $this->language->get('text_active') : $this->language->get('text_inactive')), 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 'selected' => isset($this->request->post['selected']) && in_array($result['poll_id'], $this->request->post['selected']), 'action' => $action ); } $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['text_date_added'] = $this->language->get('text_date_added'); $this->data['text_enabled'] = $this->language->get('text_enabled'); $this->data['text_disabled'] = $this->language->get('text_disabled'); $this->data['text_no_results'] = $this->language->get('text_no_results'); $this->data['column_question'] = $this->language->get('column_question'); $this->data['column_status'] = $this->language->get('column_status'); $this->data['column_active'] = $this->language->get('column_active'); $this->data['column_date_added'] = $this->language->get('column_date_added'); $this->data['column_action'] = $this->language->get('column_action'); $this->data['button_insert'] = $this->language->get('button_insert'); $this->data['button_delete'] = $this->language->get('button_delete'); if (isset($this->error['warning'])) { $this->data['error_warning'] = $this->error['warning']; } else { $this->data['error_warning'] = ''; } if (isset($this->session->data['success'])) { $this->data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $this->data['success'] = ''; } $this->template = 'catalog/poll_list.tpl'; $this->children = array( 'common/header', 'common/footer' ); $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression')); } private function getForm() { $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['text_enabled'] = $this->language->get('text_enabled'); $this->data['text_disabled'] = $this->language->get('text_disabled'); $this->data['text_active'] = $this->language->get('text_active'); $this->data['text_inactive'] = $this->language->get('text_inactive'); $this->data['text_none'] = $this->language->get('text_none'); $this->data['text_new_poll'] = $this->language->get('text_new_poll'); $this->data['text_no_votes'] = $this->language->get('text_no_votes'); $this->data['entry_question'] = $this->language->get('entry_question'); for ($i = 1; $i <= 8; $i++) { $this->data['entry_answer_' . $i] = $this->language->get('entry_answer_' . $i); } $this->data['entry_status'] = $this->language->get('entry_status'); $this->data['entry_active'] = $this->language->get('entry_active'); $this->data['button_save'] = $this->language->get('button_save'); $this->data['button_cancel'] = $this->language->get('button_cancel'); $this->data['tab_general'] = $this->language->get('tab_general'); $this->data['tab_data'] = $this->language->get('tab_data'); $this->data['tab_results'] = $this->language->get('tab_results'); // Extract results if (isset($this->request->get['poll_id'])) { $poll_id = $this->request->get['poll_id']; $poll_data = $this->model_catalog_poll->getPollData($poll_id); $reactions = $this->model_catalog_poll->getPollResults($poll_id); $total_votes = $this->model_catalog_poll->getTotalResults($poll_id); if ($reactions) { $this->data['reactions'] = TRUE; $percent = array(0, 0, 0, 0, 0, 0, 0, 0); $totals = array(0, 0, 0, 0, 0, 0, 0, 0); foreach($reactions as $reaction) { $totals[$reaction['answer'] - 1]++; } for($i = 0; $i < 8; $i++) { $percent[$i] = round(100 * ($totals[$i]/$total_votes)); } $this->data['poll_data'] = $poll_data; $this->data['percent'] = $percent; $this->data['total_votes'] = $total_votes; $this->data['text_poll_results'] = $this->language->get('text_poll_results'); $this->data['text_percent'] = $this->language->get('text_percent'); $this->data['text_answer'] = $this->language->get('text_answer'); } } // End extraction of results if (isset($this->error['warning'])) { $this->data['error_warning'] = $this->error['warning']; } else { $this->data['error_warning'] = ''; } if (isset($this->error['question'])) { $this->data['error_question'] = $this->error['question']; } else { $this->data['error_question'] = ''; } for ($i = 1; $i <= 8; $i++) { if (isset($this->error['answer_' . $i])) { $this->data['error_answer_' . $i] = $this->error['answer_' . $i]; } else { $this->data['error_answer_' . $i] = ''; } } if (isset($this->error['active_poll'])) { $this->data['error_active_poll'] = $this->error['active_poll']; } else { $this->data['error_active_poll'] = ''; } $this->document->breadcrumbs = array(); $this->document->breadcrumbs[] = array( 'href' => HTTPS_SERVER . 'index.php?route=common/home', 'text' => $this->language->get('text_home'), 'separator' => FALSE ); $this->document->breadcrumbs[] = array( 'href' => HTTPS_SERVER . 'index.php?route=catalog/poll', 'text' => $this->language->get('heading_title'), 'separator' => ' :: ' ); if (!isset($this->request->get['poll_id'])) { $this->data['new_poll'] = TRUE; $this->data['action'] = HTTPS_SERVER .'index.php?route=catalog/poll/insert'; } else { $this->data['action'] = HTTPS_SERVER . 'index.php?route=catalog/poll/update&poll_id=' . $this->request->get['poll_id'] . $url; } $this->data['cancel'] = HTTPS_SERVER . 'index.php?route=catalog/poll' . $url; if ((isset($this->request->get['poll_id'])) && ($this->request->server['REQUEST_METHOD'] != 'POST')) { $poll_info = $this->model_catalog_poll->getPoll($this->request->get['poll_id']); } $this->load->model('localisation/language'); $this->data['languages'] = $this->model_localisation_language->getLanguages(); if (isset($this->request->post['poll_description'])) { $this->data['poll_description'] = $this->request->post['poll_description']; } elseif (isset($poll_info)) { $this->data['poll_description'] = $this->model_catalog_poll->getPollDescriptions($this->request->get['poll_id']); } else { $this->data['poll_description'] = array(); } if (isset($this->request->post['status'])) { $this->data['status'] = $this->request->post['status']; } elseif (isset($poll_info)) { $this->data['status'] = $poll_info['status']; } else { $this->data['status'] = ''; } if (isset($this->request->post['active'])) { $this->data['active'] = $this->request->post['active']; } elseif (isset($poll_info)) { $this->data['active'] = $poll_info['active']; } else { $this->data['active'] = ''; } $this->template = 'catalog/poll_form.tpl'; $this->children = array( 'common/header', 'common/footer' ); $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression')); } private function validateForm() { if (!$this->user->hasPermission('modify', 'catalog/poll')) { $this->error['warning'] = $this->language->get('error_permission'); } foreach ($this->request->post['poll_description'] as $language_id => $value) { if ((strlen(utf8_decode($value['question'])) < 2) || (strlen(utf8_decode($value['question'])) > 255)) { $this->error['question'][$language_id] = $this->language->get('error_question'); } for ($i = 1; $i <= 8; $i++) { if ((strlen(utf8_decode($value['answer_' . $i])) > 0) && ((strlen(utf8_decode($value['answer_' . $i])) < 2) || (strlen(utf8_decode($value['answer_' . $i])) > 255))) { $this->error['answer_' . $i][$language_id] = $this->language->get('error_answer'); } } if ($this->request->post['active'] == 1) { $check_active_poll = $this->model_catalog_poll->checkActivePoll(); if ($check_active_poll) { $active_poll = $this->model_catalog_poll->getActivePoll(); if ($active_poll['poll_id'] != $this->request->get['poll_id']) { $this->error['active_poll'][$language_id] = $this->language->get('error_active_poll'); } } } } if (!$this->error) { return TRUE; } else { return FALSE; } } private function validateDelete() { if (!$this->user->hasPermission('modify', 'catalog/poll')) { $this->error['warning'] = $this->language->get('error_permission'); } if (!$this->error) { return TRUE; } else { return FALSE; } }}?>
  2. Вот тут заметил у себя одну проблему и врогде кажется она уже у меня давно. http://shopcomputer.ru/ При навегдение на кнопку искать мышка почему-то показывает выгделение, а не ну короче понятно ;) И ик врогде со всеми кнопками <a onclick= Кто-нибудь знает как это можно исправить?
  3. Вот умник нашелся, те надо ты и ули.А свои игдеи высказать слили?Всем спасипотому что, уже решил проблему.
  4. Здравствуйте1 Я чет не могу разобраться, как в файлах .tpl кнопку-ссылку. Только ссылку в опрегделенное место, ик как эти кнопки мне нужно бугдет раскидать по всему движку. <a class="button1"><span><?php echo $warning2; ?></span></a> А вот как сюда ссылку примостить допустим в yandex?
  5. Да с контроллерами и кодировками то я пропотому чтовал уже и ксити тоже notepad++ пользуюсь. Мне другой способ интересовал, но я уже решил свою проблему.
  6. Мне необходимо вывести другую информацию на главной страниэто вместо последних товаров. Делать сразу в home.tpl не полулится, ик как он не воспринимает русские буквы. Как еещё можно это сгделать?
  7. а ты думаешь зря некоторые на 1.4.0 сидят !? да уж потому чтольно много недочетов в 1.4.0, чтоб из-за модулей на ней осиваться.
  8. Кто-нибудь может обновить до 1.4.7Модулей много, а половину не рилииет...
  9. спасипотому что за быстрый ответ! Вот в чем мой вопрос: Понимаете мне экспорт нужно распечатывать для учеи, а им вместо полей, id_.
  10. Смысл в том, что тот файл который он выбросил сам и не принимает. Я ик понимаю импори нормального все равно не добиться. Поэтому хочу хотя бы экспорт под себя настроить для учеи.Вы ответите на мой вопрос?
  11. Он тот который экспортирует тоже не принимает. Но пока главное мне изменить, то что он выдает!
  12. Здравствуйте.Тот файл, который выводит модуль экспори мне совсем не годится. Скажите в каком точно файле это можно поправить. И еещё можете объяснить как должен выглягдеть файл excel, а то какие не пропотому чтовал, вообещё ничего не кушает.Спасипотому что.
×
×
  • 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.