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

Valery332

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

    153
  • Joined

  • Last visited

Recent Profile Visitors

1,696 profile views

Valery332's Achievements

Community Regular

Community Regular (8/14)

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

Recent Badges

1

Reputation

  1. Добрый гдень. Прошу готовое решение для текуещёго контроллера категорий. Что нужно: Если категории 2-го уровня используем $this->response->setOutput($this->load->view('product/category', $data)); else $this->response->setOutput($this->load->view('product/category2', $data)); <?php class ControllerProductCategory extends Controller { public function index() { $this->load->language('product/category'); $this->load->model('catalog/category'); $this->load->model('catalog/product'); $this->load->model('tool/image'); if (isset($this->request->get['filter'])) { $filter = $this->request->get['filter']; } else { $filter = ''; } if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'p.sort_order'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; } if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } if (isset($this->request->get['limit'])) { $limit = (int)$this->request->get['limit']; } else { $limit = $this->config->get('theme_' . $this->config->get('config_theme') . '_product_limit'); } $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home') ); if (isset($this->request->get['path'])) { $url = ''; if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $path = ''; $parts = explode('_', (string)$this->request->get['path']); $category_id = (int)array_pop($parts); foreach ($parts as $path_id) { if (!$path) { $path = (int)$path_id; } else { $path .= '_' . (int)$path_id; } $category_info = $this->model_catalog_category->getCategory($path_id); if ($category_info) { $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path . $url) ); } } } else { $category_id = 0; } $category_info = $this->model_catalog_category->getCategory($category_id); if ($category_info) { $this->document->setTitle($category_info['meta_title']); $this->document->setDescription($category_info['meta_description']); $this->document->setKeywords($category_info['meta_keyword']); $data['heading_title'] = $category_info['name']; $data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0)); // Set the last category breadcrumb $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path']) ); if ($category_info['image']) { $data['thumb'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_category_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_category_height')); } else { $data['thumb'] = ''; } $data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8'); $data['compare'] = $this->url->link('product/compare'); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['categories'] = array(); $results = $this->model_catalog_category->getCategories($category_id); foreach ($results as $result) { $filter_data = array( 'filter_category_id' => $result['category_id'], 'filter_sub_category' => true ); if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], 255, 215); } else { $image = $this->model_tool_image->resize('placeholder.png', 255, 215); } $data['categories'][] = array( 'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url), 'thumb' => $image ); } $data['products'] = array(); $filter_data = array( 'filter_category_id' => $category_id, 'filter_filter' => $filter, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $limit, 'limit' => $limit ); $product_total = $this->model_catalog_product->getTotalProducts($filter_data); $results = $this->model_catalog_product->getProducts($filter_data); foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height')); } else { $image = $this->model_tool_image->resize('placeholder.png', $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height')); } if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']); } else { $price = false; } if ((float)$result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']); } else { $special = false; } if ($this->config->get('config_tax')) { $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price'], $this->session->data['currency']); } else { $tax = false; } if ($this->config->get('config_review_status')) { $rating = (int)$result['rating']; } else { $rating = false; } $data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], 'description' => trim(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'))), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length'), 'price' => $price, 'special' => $special, 'tax' => $tax, 'minimum' => $result['minimum'] > 0 ? $result['minimum'] : 1, 'rating' => $result['rating'], 'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['sorts'] = array(); $data['sorts'][] = array( 'text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $url) ); if ($this->config->get('config_review_status')) { $data['sorts'][] = array( 'text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $url) ); } $data['sorts'][] = array( 'text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=DESC' . $url) ); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } $data['limits'] = array(); $limits = array_unique(array($this->config->get('theme_' . $this->config->get('config_theme') . '_product_limit'), 25, 50, 75, 100)); sort($limits); foreach($limits as $value) { $data['limits'][] = array( 'text' => $value, 'value' => $value, 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&limit=' . $value) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $pagination = new Pagination(); $pagination->total = $product_total; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}'); $data['pagination'] = $pagination->render(); $data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit)); // http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html if ($page == 1) { $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id']), 'canonical'); } else { $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. $page), 'canonical'); } if ($page > 1) { $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . (($page - 2) ? '&page='. ($page - 1) : '')), 'prev'); } if ($limit && ceil($product_total / $limit) > $page) { $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page + 1)), 'next'); } $data['sort'] = $sort; $data['order'] = $order; $data['limit'] = $limit; $data['continue'] = $this->url->link('common/home'); $data['column_left'] = $this->load->controller('common/column_left'); $data['column_right'] = $this->load->controller('common/column_right'); $data['content_top'] = $this->load->controller('common/content_top'); $data['content_bottom'] = $this->load->controller('common/content_bottom'); $data['footer'] = $this->load->controller('common/footer'); $data['header'] = $this->load->controller('common/header'); $childns = $this->model_catalog_category->getCategoriesAll($category_info['category_id']); if ($category_info['category_id'] == 67){ $this->response->setOutput($this->load->view('product/categoryall', $data)); } elseif ($category_info['category_id'] == 69) { $this->response->setOutput($this->load->view('product/helper', $data)); } elseif ($category_info['category_id'] == 101) { $data['categories'] = array(); $results = $this->model_catalog_category->getCategories($category_id); foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], 345, 200); } else { $image = $this->model_tool_image->resize('placeholder.png', 255, 255); } $data_child = array(); $child_results = $this->model_catalog_category->getCategories($result['category_id']); if($child_results){ foreach ($child_results as $child) { $data_child[] = array( 'name' => $child['name'], 'href' => $this->url->link('product/category', 'path=' . $child['category_id']) ); } } $data['categories'][] = array( 'name' => $result['name'], 'href' => $this->url->link('product/category', 'path=' . $result['category_id']), 'thumb' => $image, 'children' => $data_child ); } $this->response->setOutput($this->load->view('product/catalog', $data)); } // elseif($childns){ // $this->response->setOutput($this->load->view('product/subcatalog', $data)); // } else{ $this->response->setOutput($this->load->view('product/category', $data)); } } else { $url = ''; if (isset($this->request->get['path'])) { $url .= '&path=' . $this->request->get['path']; } if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_error'), 'href' => $this->url->link('product/category', $url) ); $this->document->setTitle($this->language->get('text_error')); $data['continue'] = $this->url->link('common/home'); $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . ' 404 Not Found'); $data['column_left'] = $this->load->controller('common/column_left'); $data['column_right'] = $this->load->controller('common/column_right'); $data['content_top'] = $this->load->controller('common/content_top'); $data['content_bottom'] = $this->load->controller('common/content_bottom'); $data['footer'] = $this->load->controller('common/footer'); $data['header'] = $this->load->controller('common/header'); $this->response->setOutput($this->load->view('error/not_found', $data)); } } }
  2. При попытке при попытке авторизации по апи выдает икое: Может кто-то уже силкивался, в чем может быть проблема? <b>Notice</b>: Undefined variable: config in <b>/home/eshopper/САЙТ.КОМ/www/catalog/controller/api/login.php</b> on line <b>32</b><br /> <b>Fatal error</b>: Uncaught Error: Call to a member function get() on null in /home/eshopper/САЙТ.КОМ/www/catalog/controller/api/login.php:32 Stack trace: #0 /home/eshopper/САЙТ.КОМ/storage/modification/system/engine/action.php(79): ControllerApiLogin->index() #1 /home/eshopper/САЙТ.КОМ/www/catalog/controller/startup/router.php(25): Action->execute(Object(Registry)) #2 /home/eshopper/САЙТ.КОМ/storage/modification/system/engine/action.php(79): ControllerStartupRouter->index() #3 /home/eshopper/САЙТ.КОМ/www/system/engine/router.php(67): Action->execute(Object(Registry)) #4 /home/eshopper/САЙТ.КОМ/www/system/engine/router.php(56): Router->execute(Object(Action)) #5 /home/eshopper/САЙТ.КОМ/www/system/framework.php(168): Router->dispatch(Object(Action), Object(Action)) #6 /home/eshopper/САЙТ.КОМ/www/system/startup.php(104): require_once('/home/eshopper/...') #7 /home/eshopper/САЙТ.КОМ/www/index.php(19): start('catalog') #8 {main}
  3. Добрый гдень. Как отклюлить уведомления о смене ситуса заказа в опенкарт3?
  4. Добрый гдень. Как вывести изображение опции, для типа опций "список"? {% if option_value.image %} <img src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price %} {{ option_value.price_prefix }} {{ option_value.price }} {% endif %}" class="img-thumbnail" /> {% endif %} Скопировал код с другого типа опций, но не помогло, видимо нужно лесть еещё в контроллеры, ток куда конкретно?
  5. Добрый гдень. Дано: На сайт под управлением CMS Opencart был усиновлен модуль "Экспорт-Импорт" Дополнительно программистом в него были вывегдены произвольные поля. Если просто выгрузить файл, внести изменения в текущие товары, а потом загрузить обратно, то все рилииет исправно. Но как только добавляю новые позиции, модуль не хочет его принимать. Хочу найти человека кто на постоянной основе занимается рилитот с этим модулем, и проконсультирует меня по его рилите. Задача: - В этолях теси добавить несколько товаров в файл exel с заполнением всех суещёствующих параметров и загрузить на сайт при помощи модуля. - Сгделать краткую письменную или вигдео инструкцию, как правильно это гделать.
  6. Добрый гдень. Был усиновлен модуль "Экспорт-Импорт" Дополнительно программистом в него были вывегдены произвольные поля. Если просто выгрузить файл, внести изменения в текущие товары, а потом загрузить обратно, то все рилииет исправно. Но как только добавляю новые позиции, модуль не хочет его принимать.
  7. Добрый гдень. Нужно настроить Mega Filter Горизонильный вид в гдесктопе(максимум 4 значения атрибутов и кнопку "Показать все фильтры"), в мобильном свернут/развернут по кнопке. http://joxi.ru/nAyMWbVHaVPe5A http://joxi.ru/E2p9GBou4bPyLA
  8. Добрый гдень. Подскажите пожалуйси как задать 2 момени: 1. Сгделать фильтр с горизонильным отображением. 2. Выводить только 4 параметра фильтрации, осильные свораливать. Что должно полулиться по итогу: http://joxi.ru/nAyMWbVHaVPe5A
  9. Наверно вы об этом https://github.com/ololower/Synonymizer Ума как этим воспользоваться, тоже не хватило)
  10. Предсивления о сложности задали нет, из-за слабых знаний. По вашей реакции, я предполагаю что задача с лисла коммерческих и бесплатно полулить решение мне не удастся. Хорошо, готов оплатить.
  11. Добрый вечер. Логически задача выглядит ик: Есть массив в котором согдержатся разные варианты(синонимы) текси из которого произвольным обвместе для каждой последуюещёй карточки товара формируется текст. купить | приобрести | заказать Одна карточка товара = одно значение текси. Прошу готовый php код.
  12. Можно как обезьянке куда что, на что заменить? public function getProductRelated($product_id) { $product_data = array(); $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_related pr LEFT JOIN " . DB_PREFIX . "product p ON (pr.related_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pr.product_id = '" . (int)$product_id . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'"); foreach ($query->rows as $result) { $product_data[$result['related_id']] = $this->getProduct($result['related_id']); } return $product_data; }
  13. Добрый гдень. Как сгделать ик что-бы в карточке товара не выводились похожие(рекомендуем) товары, если их нет в налилии?
  14. Добрый гдень. Со стороны CRM OneBox нам присылают икие ошибки, говорят что это на стороне нашего сайи "при попытке авторизации по апи. Это листо файлы самого опенкари www/catalog/controller/api/login.php" <b>Notice</b>: Undefined variable: config in <b>/home/eshopper/НАШ.САЙТ/www/catalog/controller/api/login.php</b> on line <b>32</b><br /> <b>Fatal error</b>: Uncaught Error: Call to a member function get() on null in /home/eshopper/НАШ.САЙТ/www/catalog/controller/api/login.php:32 Stack trace: #0 /home/eshopper/НАШ.САЙТ/storage/modification/system/engine/action.php(79): ControllerApiLogin->index() #1 /home/eshopper/НАШ.САЙТ/www/catalog/controller/startup/router.php(25): Action->execute(Object(Registry)) #2 /home/eshopper/НАШ.САЙТ/storage/modification/system/engine/action.php(79): ControllerStartupRouter->index() #3 /home/eshopper/НАШ.САЙТ/www/system/engine/router.php(67): Action->execute(Object(Registry)) #4 /home/eshopper/НАШ.САЙТ/www/system/engine/router.php(56): Router->execute(Object(Action)) #5 /home/eshopper/НАШ.САЙТ/www/system/framework.php(168): Router->dispatch(Object(Action), Object(Action)) #6 /home/eshopper/НАШ.САЙТ/www/system/startup.php(104): require_once('/home/eshopper/...') #7 /home/eshopper/НАШ.САЙТ/www/index.php(19): start('catalog') #8 {main} Кто может разобраться в чем гдело?
×
×
  • 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.