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

[Модуль] Фильтр товаров в категории 2.0 / 3.0


Recommended Posts

Ребятушки, предлагаю несколько сбавить 1) пыл общения 2) темпы накопления флейма в этой теме.

Надіслати
Поділитися на інших сайтах


Был на сайте: 1 год 2 месяца 27 дней назад

:mrgreen:

ЗЫ. Посмотрел его фото "в контакте". Молодой человек приятной наружности. Такой не может быть нехорошим человеком. Видимо, просто до безобразия непунктуальный. Зря я его обижал. Больше не буду. :ugeek:

Надіслати
Поділитися на інших сайтах


Прошу прощения за возможно уже заданный вопрос, но возможно ли этот фильтр вынести на главную? Читать 30 страниц форума нет желания.

Спасибо

Незачем читать 30 страниц, можно просто посмотреть на название темы

Фильтр товаров в категории 2.0

Надіслати
Поділитися на інших сайтах


А вы у Sheridanа спросите. Он очень умный товарищ:

...Я решение купить именно этот модуль принял после досконального изучения вопроса

Вот сижу, жду. ... Соор занят наверное.

;)
Надіслати
Поділитися на інших сайтах


Никто не в курсе, есть ли смысл ждать?

Если время поджимает, ИМХО лучше смотреть в сторону модуля freelancer'a (Filter Pro который).

Однако надежда есть, SooR почтил нас своим присутствием сегодня :-D

Активность: OFFLINE Сегодня, 00:25

Надіслати
Поділитися на інших сайтах

Это который за 45$? А вы им пользовались? Насколько он хорош в реальных условиях с большими объемами продукции? Модуль freelancer'a выглядит пошустрее, не знаю каким будет новый модуль SooR'а конечно.

Надіслати
Поділитися на інших сайтах

сейчас пользуюсь. правда магазин только на стадии наполнения ( и я не умею наполнять разом по 10 тысяч товаров) но с тем что есть работает довольно шустро. Есть то чего в фильтреПро просто нет ( у меня они оба есть так что могу сравнить) - ,например, можно указать по какому атрибуту выводить фильтрацию, а по какому нет для каждой группы атрибутов. каждому атрибуту можно указать - развернутый список параметров выводить или же свернутый. Указать по каким именно производителям хочешь выводить фильтрацию,а какие и не появятся в фильтре, так же по тегам, опциям...

Это приятно и подкупает, ощущения зря отгаданных денег не возникает ни за него ни за фильтр про.

  • +1 1
Надіслати
Поділитися на інших сайтах


А вы у Sheridanа спросите. Он очень умный товарищ:

;)

Шеридан уже задолбался и его админ написал за пиво такой фильтр. Иногда люди своим поведением намекают, что не стОит переоценивать сложность подобных продуктов.

Надіслати
Поділитися на інших сайтах


  • 2 weeks later...

Кто нибудь знает какие таблицы добавляются в БД после нажатия кнопки "Установить таблицы"?

Мне нужно их оттуда удалить, иначе модуль повторно не устанавливается. Точнее при редактировании товара нет вкладки "Опции фильтра"

---------------

Разобрался, уже не актуально)

Змінено користувачем Rustem
Надіслати
Поділитися на інших сайтах


  • 2 weeks later...

Не подскажите что произошло и как решить проблему ?

При нажатии на "Акции" показывает такую ошибку:

Notice: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.sort_order ASC LIMIT 0,15' at line 1

Error No: 1064

SELECT DISTINCT ps.product_id, (SELECT AVG(rating) FROM review r1 WHERE r1.product_id = ps.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating FROM product_special ps LEFT JOIN product p ON (ps.product_id = p.product_id) LEFT JOIN product_description pd ON (p.product_id = pd.product_id) LEFT JOIN product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' AND ps.customer_group_id = '8' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) GROUP BY ps.product_id ORDER BY p.sort_order ORDER BY p.sort_order ASC LIMIT 0,15 in Z:hometimwwwsystemdatabasemysql.php on line 49

ocStore 1.5.2.1

Надіслати
Поділитися на інших сайтах


Добрый день.

на ocStore 1.5.3.1 установил данный модуль, сделал всё необходимое по инструкции

модуль отображается в магазине, в нём есть товары, но при попытке выбрать любое значение получаем:

Not Found

The requested URL /225 (1) was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/1.3.41 Server at mybestitem.ru Port 80

где 225 (1) - то самое значение которое выбираем в фильтре

Пожалуйста, подскажите в чём причина?? И как устранить?

Надіслати
Поділитися на інших сайтах


Всем привет! Есть проблема, которую уже поднимали (атрибуты в даном случае это значения опций фильтра):

у меня атрибуты фильтра не сохраняются в том порядке, в котором я их забиваю - все время отображаются в хаотическом порядке. как исправить кто-нибудь знает?

Так же есть решение:

Файл

catalog/model/catalog/filter.php
В запрос функции

public function getOptionValues($option_id) {
добавить

ORDER BY covd.`name` ASC
Должно получиться так:

public function getOptionValues($option_id) {
   $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "category_option_value cov LEFT JOIN " . DB_PREFIX . "category_option_value_description covd ON (cov.value_id = covd.value_id) WHERE cov.option_id = '" . (int)$option_id . "' AND covd.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY covd.`name` ASC");

Но. В таком случае сортировка значений опции будет по алфавиту. Может кто-то подсказать как сделать, что бы значения выводились в том порядке, в котором их добавили первым - первое, вторим - второе и т.д.

mod.name: [Модуль] [sooR] Фильтр товаров в категории 2.0 Переделанный модуль. Стабильный и правильный.

ocStore 0.2.2

Заранее спасибо!

Надіслати
Поділитися на інших сайтах


Подскажите, мож кто сталкивался с такой проблемой. Фильтр установил, создал новые опции в разделе "фильр товаров", а вот самом товаре в разделе опции ничего создать не могу. Есть только поле ввода с "+" справа. Если начинаю вводить в поле ввода назавание, окна выбора не пояляется?

В чем может быть причина?Куда копать?

Надіслати
Поділитися на інших сайтах


Подскажите, мож кто сталкивался с такой проблемой. Фильтр установил, создал новые опции в разделе "фильр товаров", а вот самом товаре в разделе опции ничего создать не могу. Есть только поле ввода с "+" справа. Если начинаю вводить в поле ввода назавание, окна выбора не пояляется?

В чем может быть причина?Куда копать?

для начала вы бы хоть версию фильтра и магазина указали.

а вообще мне кажется что форум глохнет потихоньку.. или все перешли на новую версию магазина... или всё настроили и не появляются здесь, одним словом совета приходится ждать долго, если конечно он будет

Надіслати
Поділитися на інших сайтах


Народ, подскажите пожалуйста.

Еще вопрос возник...

При просмотре отфильтрованных товаров, нет возможности изменить сортировку. Он пересортировывает все товары, без учета фильтров. Или это я что-то не так сделал??

Если сделать как писал SOOR

LiS, сравните код с вашим в category.php

if (isset($this->request->get['filter'])) {
  $url .= '&filter=' . $this->request->get['filter'];
}

$this->data['sorts'] = array();

И стоит ли переменная $url во всех элементах массива sorts?

Должно быть так:

if (isset($this->request->get['filter'])) {

$url .= '&filter=' . $this->request->get['filter'];

}

$this->data['sorts'] = array();

$this->data['sorts'][] = array('text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $url)));

$this->data['sorts'][] = array('text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $url)));

$this->data['sorts'][] = array('text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $url)));

$this->data['sorts'][] = array('text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $url)));

$this->data['sorts'][] = array('text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $url)));

$this->data['sorts'][] = array('text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $url)));

Внимание, состав элементов массива sorts в вашей версии OpenCart может отличаться! Так что не копируйте данный код, а просто исправьте при необходимости свой.

то сортировка действительно работает, но при перелистывании страницы с товарами фильтр обнуляется точно так же как и было при смене сортировки.

Файл category.php такой:

<?php
class ControllerProductCategory extends Controller {
public function index() {
$this->language->load('product/category');

$this->document->breadcrumbs = array();

$this->document->breadcrumbs[] = array(
'href' => HTTP_SERVER . 'index.php?route=common/home',
'text' => $this->language->get('text_home'),
'separator' => FALSE
);

$this->load->model('catalog/category');
$this->load->model('tool/seo_url');

if (isset($this->request->get['path'])) {
$path = '';

$parts = explode('_', $this->request->get['path']);

foreach ($parts as $path_id) {
$category_info = $this->model_catalog_category->getCategory($path_id);

if ($category_info) {
if (!$path) {
$path = $path_id;
} else {
$path .= '_' . $path_id;
}

$this->document->breadcrumbs[] = array(
'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $path),
'text' => $category_info['name'],
'separator' => $this->language->get('text_separator')
);
}
}

$category_id = array_pop($parts);
} else {
$category_id = 0;
}

$category_info = $this->model_catalog_category->getCategory($category_id);

if ($category_info) {
$this->document->title = ($category_info['title']) ? $category_info['title'] : $category_info['name'];

$this->document->keywords = $category_info['meta_keywords'];

$this->document->description = $category_info['meta_description'];

$this->data['heading_title'] = ($category_info['h1']) ? $category_info['h1'] : $category_info['name'];

$this->data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');

$this->data['text_sort'] = $this->language->get('text_sort');

$this->data['text_error'] = $this->language->get('text_empty');

$this->load->model('tool/image');

if ($category_info['image']) {
$image = $category_info['image'];
} else {
$image = '';
}

$this->data['thumb'] = $this->model_tool_image->resize($image, $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));

if (isset($this->request->get['page'])) {
$page = $this->request->get['page'];
} else {
$page = 1;
}

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';
}
// Start Filter
if (isset($this->request->get['filter'])) {
$filter = $this->request->get['filter'];
} else {
$filter = '';
}
// End filter
$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'];
}
// Start Filter
if (isset($this->request->get['filter'])) {
$url .= '&filter=' . $this->request->get['filter'];
}
// End Filter
$this->load->model('catalog/product');

$category_total = $this->model_catalog_category->getTotalCategoriesByCategoryId($category_id);
$product_total = $this->model_catalog_product->getTotalProductsByCategoryId($category_id, $filter);

if ($category_total || $product_total) {
$this->data['categories'] = array();

$results = $this->model_catalog_category->getCategories($category_id);

foreach ($results as $result) {
if ($result['image']) {
$image = $result['image'];
} else {
$image = 'no_image.jpg';
}

$this->data['categories'][] = array(
'name' => $result['name'],
'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url),
'thumb' => $this->model_tool_image->resize($image, $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'))
);
}

$this->load->model('catalog/review');

$this->data['button_add_to_cart'] = $this->language->get('button_add_to_cart');

$this->data['products'] = array();

$results = $this->model_catalog_product->getProductsByCategoryId($category_id, $filter, $sort, $order, ($page - 1) * $this->config->get('config_catalog_limit'), $this->config->get('config_catalog_limit'));

foreach ($results as $result) {
if ($result['image']) {
$image = $result['image'];
} else {
$image = 'no_image.jpg';
}

if ($this->config->get('config_review')) {
$rating = $this->model_catalog_review->getAverageRating($result['product_id']);
} else {
$rating = false;
}

$special = FALSE;

$discount = $this->model_catalog_product->getProductDiscount($result['product_id']);

if ($discount) {
$price = $this->currency->format($this->tax->calculate($discount, $result['tax_class_id'], $this->config->get('config_tax')));
} else {
$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));

$special = $this->model_catalog_product->getProductSpecial($result['product_id']);

if ($special) {
$special = $this->currency->format($this->tax->calculate($special, $result['tax_class_id'], $this->config->get('config_tax')));
}
}

$options = $this->model_catalog_product->getProductOptions($result['product_id']);

if ($options) {
$add = $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']);
} else {
$add = HTTPS_SERVER . 'index.php?route=checkout/cart&product_id=' . $result['product_id'];
}

$this->data['products'][] = array(
'name' => $result['name'],
'model' => $result['model'],
'rating' => $rating,
'stars' => sprintf($this->language->get('text_stars'), $rating),
'thumb' => $this->model_tool_image->resize($image, $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')),
'price' => $price,
'options' => $options,
'special' => $special,
'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&path=' . $this->request->get['path'] . '&product_id=' . $result['product_id']),
'add' => $add
);
}

if (!$this->config->get('config_customer_price')) {
$this->data['display_price'] = TRUE;
} elseif ($this->customer->isLogged()) {
$this->data['display_price'] = TRUE;
} else {
$this->data['display_price'] = FALSE;
}

$url = '';

if (isset($this->request->get['page'])) {
$url .= '&page=' . $this->request->get['page'];
}

$this->data['sorts'] = array();

$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')
);
*/
$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'];
}
// Start filter
if (isset($this->request->get['filter'])) {
$url .= '&filter=' . $this->request->get['filter'];
}
// End filter

$pagination = new Pagination();
$pagination->total = $product_total;
$pagination->page = $page;
$pagination->limit = $this->config->get('config_catalog_limit');
$pagination->text = $this->language->get('text_pagination');
$pagination->url = $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . $url . '&page={page}');

$this->data['pagination'] = $pagination->render();

$this->data['sort'] = $sort;
$this->data['order'] = $order;

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) {
$this->template = $this->config->get('config_template') . '/template/product/category.tpl';
} else {
$this->template = 'default/template/product/category.tpl';
}

$this->children = array(
'common/column_right',
'common/column_left',
'common/footer',
'common/header'
);

$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
} else {
$this->document->title = ($category_info['title']) ? $category_info['title'] : $category_info['name']; ;

$this->document->description = $category_info['meta_description'];

$this->data['heading_title'] = ($category_info['h1']) ? $category_info['h1'] : $category_info['name'];;

$this->data['text_error'] = $this->language->get('text_empty');

$this->data['button_continue'] = $this->language->get('button_continue');

$this->data['continue'] = HTTP_SERVER . 'index.php?route=common/home';

$this->data['categories'] = array();

$this->data['products'] = array();

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) {
$this->template = $this->config->get('config_template') . '/template/product/category.tpl';
} else {
$this->template = 'default/template/product/category.tpl';
}

$this->children = array(
'common/column_right',
'common/column_left',
'common/footer',
'common/header'
);

$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
}
} else {
$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'];
}
// Start filter
if (isset($this->request->get['filter'])) {
$url .= '&filter=' . $this->request->get['filter'];
}
// End filter
if (isset($this->request->get['page'])) {
$url .= '&page=' . $this->request->get['page'];
}

if (isset($this->request->get['path'])) {
$this->document->breadcrumbs[] = array(
'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . $url),
'text' => $this->language->get('text_error'),
'separator' => $this->language->get('text_separator')
);
}

$this->document->title = $this->language->get('text_error');

$this->data['heading_title'] = $this->language->get('text_error');

$this->data['text_error'] = $this->language->get('text_error');

$this->data['button_continue'] = $this->language->get('button_continue');

$this->data['continue'] = HTTP_SERVER . 'index.php?route=common/home';

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
$this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
} else {
$this->template = 'default/template/error/not_found.tpl';
}

$this->children = array(
'common/column_right',
'common/column_left',
'common/footer',
'common/header'
);

$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
}
}
}
?>

Как сделать что бы работало все вместе?

Надіслати
Поділитися на інших сайтах


Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз
  • Зараз на сторінці   0 користувачів

    • Ні користувачів, які переглядиють цю сторінку

×
×
  • Створити...

Important Information

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