Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

Tsamada

Новачок
  
  • Публікації

    5
  • З нами

  • Відвідування

Усі публікації користувача Tsamada

  1. Можно как бы так (1.5.4.1): /catalog/controller/product/compare.php Ищем (~10 строка) if (!isset($this->session->data['compare'])) { $this->session->data['compare'] = array(); } После добавляем if (!isset($this->session->data['cat_id'])) { $this->session->data['cat_id'] = array(); } Ищем (~174 строка) public function add() { В ней ищем (~193 строка) if ($product_info) { После добавляем /**/ $in_category = array(); $q = $this->db->query("SELECT p2c.`category_id`, cd.name FROM " . DB_PREFIX . "product_to_category p2c LEFT join " . DB_PREFIX . "category_description cd ON cd.category_id = p2c.`category_id` WHERE product_id = '".$product_id."' AND cd.language_id = '" . (int)$this->config->get('config_language_id') . "'"); if ($q->num_rows) { $rows = $q->rows; foreach ($rows as $row) { $el = array(); $el['name'] = $row['name']; $el['cat_id'] = $row['category_id']; $el['href'] = $this->url->link('product/category', 'path=' . $row['category_id']); $in_category[] = $el; } } if (count($in_category)) { $mas = array(); foreach ($in_category as $cat) { $mas[] = $cat['cat_id']; } } if ( !array_intersect($this->session->data['cat_id'],$mas) ) { $this->session->data['compare'] = array(); } $this->session->data['cat_id'] = $mas; /**/ Сойдет такое решение? З.Ы.: https://opencartforum.com/topic/19648-uznat-id-kategorii/?do=findComment&comment=144820
  2. решил. открываем catalog/controller/product/category.phpищем $this->data['sorts'] = array();перед этой строкой добавить if (isset($this->request->get['manufacturer'])) { $manu = '&manufacturer=' . $this->request->get['manufacturer']; } else {$manu = '';} находим $this->data['sorts'][] = array( 'text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.price&order=ASC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.price&order=DESC') ); if ($this->config->get('config_review')) { $this->data['sorts'][] = array( 'text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=rating&order=DESC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=rating&order=ASC') ); } $this->data['sorts'][] = array( 'text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.model&order=ASC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.model&order=DESC') ); заменяем на $this->data['sorts'][] = array( 'text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $manu) ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $manu) ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $manu) ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $manu) ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $manu) ); if ($this->config->get('config_review')) { $this->data['sorts'][] = array( 'text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $manu) ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $manu) ); } $this->data['sorts'][] = array( 'text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.model&order=ASC' . $manu) ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.model&order=DESC' . $manu) ); вуаля, сортировка по имени, цене, модели и т.д. работает до или после выбора производителя
×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.