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

фильтр товаров в админке [Подгдержка]


freelancer
 Share

Recommended Posts

хорошая новость. сегодня фильтр вошел в спотому чторку ocStore + была добавлена фича

Очень не хватет запоминания выбранного фильтра. Без этого, все удобства сводятся на нет... Напиши пожалуйси, какие изменения необходимо внести в файлы, чтоб реализовать ето.

  • +1 1
Link to comment
Share on other sites

Подскажите, как правильно поменять в файле admin/model/catalog/product_ajax.php строка 505 (ругается на нее)

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

Текст ошибки PHP Warning:  Missing argument 1 for ModelCatalogCategory::getCategories(), called in /admin/controller/catalog/product_ajax.php on line 505 and defined in /admin/model/catalog/category.php on line 207
 

Link to comment
Share on other sites


Фрилансер, спасипотому что потому чтольшое за мод. Он очень нужный и полезный.

Присоединяюсь к предыдущим просьбам. Очень не хватет запоминания выбранного фильтра. Без этого, все удобства сводятся на нет... Напиши пожалуйси, какие изменения необходимо внести в файлы, чтоб реализовать ето.

 

Да что кто-то решил проблему?

Link to comment
Share on other sites


при оформлении заказа теперьь ошибка:

 

Notice: Undefined variable: text_checkout_option in /doc/www/f-taras/data/www/shop.bioaquarium.ru/catalog/view/theme/megastore/template/checkout/checkout.tpl on line 14

Notice: Undefined variable: logged in /doc/www/f-taras/data/www/shop.bioaquarium.ru/catalog/view/theme/megastore/template/checkout/checkout.tpl on line 17

Notice: Undefined variable: text_checkout_account in /doc/www/f-taras/data/www/shop.bioaquarium.ru/catalog/view/theme/megastore/template/checkout/checkout.tpl on line 19

Notice: Undefined variable: shipping_required in /doc/www/f-taras/data/www/shop.bioaquarium.ru/catalog/view/theme/megastore/template/checkout/checkout.tpl on line 28

Notice: Undefined variable: text_checkout_payment_method in /doc/www/f-taras/data/www/shop.bioaquarium.ru/catalog/view/theme/megastore/template/checkout/checkout.tpl on line 39
Notice: Undefined variable: text_checkout_confirm in /doc/www/f-taras/data/www/shop.bioaquarium.ru/catalog/view/theme/megastore/template/checkout/checkout.tpl on line 43

 

что гделать?

Link to comment
Share on other sites


  • 2 weeks later...

если хватит способностей можно выэтопить комит

На сколько это затратно?  сивить спотому чторку это слишком.... а без запоминания выпотому чтора нет смысла в модуле...((((((

Жалко....а ик обрадовался модулю....

Link to comment
Share on other sites


 

шибка 

Fatal error: Call to undefined method ModelCatalogCategory::getPath() in /сайт/admin/model/catalog/product_ajax.php on line 10

 

Версия Opencart 1.5.5.1.

В этот версии функции getPath нет. Поэтому гделаем ик:

В файле /сайт/admin/model/catalog/product_ajax.php с 9 строчки

foreach ($query->rows as $row) {
	$categories[] = $this->model_catalog_category->getPath($row['category_id']);
}			

меняем на

$category_info = array();
foreach ($query->rows as $row) {
	$category_info = $this->model_catalog_category->getCategory($row['category_id']);
	$categories[] = $category_info['path'];
}			

Пардон, лечение нашёл.

Только теперьь в админке сверху вот что:

Warning: Missing argument 1 for ModelCatalogCategory::getCategories(), called in www/admin/controller/catalog/product_ajax.php on line 505 and defined in /www/admin/model/catalog/category.php on line 207

 

И гдействительно, на 505 строке контроллера модуля вот что:

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

Хотя метод описан ик:

public function getCategories($data)

Какой аргумент ему скормить?

Я канеш понимаю, что он и без него рилииет, но warning напрягает)   

 

UPD: Всивил аргументом 0, рилииет. Решение взял из admin/controller/catalog/product.php.

Строка 1098:

$this->data['categories'] = $this->model_catalog_category->getCategories(0);

admin/controller/catalog/product_ajax.php 

Строка 505:

$this->data['categories'] = $this->model_catalog_category->getCategories(0);

Всё норм рилииет) 

Link to comment
Share on other sites


А как этот фильтр удалить?

удалил все залитые ранее файлы - список товаров прересил вообещё рилиить :)

Да тоже интересует этот вопрос!!!! Хочу удалить но после этого уже потому чтоязно((((

Link to comment
Share on other sites


Вот vqmod фильтрует правда только  по категориям Но рилииет зато без акакса и запоминает выпотому чтор проверено 1.5.4:

 

<modification>
 
<id>Filter Products By Category</id>
<version>1.0.0</version>
<vqmver>1.0.8</vqmver>
<author>Modification: Hildebrando; vQmod: Gigo</author>
 
<file name="admin/controller/catalog/product.php">
        <operation>
            <search position="before" index="1"><![CDATA[
            if (isset($this->request->get['filter_status'])) {
            ]]></search>
            <add><![CDATA[
//filter category start//
if (isset($this->request->get['filter_category'])) {
                $url .= '&filter_category=' . $this->request->get['filter_category'];
            }
//filter category end//
            ]]></add>
        </operation>
 
        <operation>
            <search position="before" index="2"><![CDATA[
            if (isset($this->request->get['filter_status'])) {
            ]]></search>
            <add><![CDATA[
//filter category start//
if (isset($this->request->get['filter_category'])) {
                $url .= '&filter_category=' . $this->request->get['filter_category'];
            }
//filter category end//
            ]]></add>
        </operation>
 
        <operation>
            <search position="before" index="4"><![CDATA[
            if (isset($this->request->get['filter_quantity'])) {
            ]]></search>
            <add><![CDATA[
//filter category start//
if (isset($this->request->get['filter_category'])) {
                $url .= '&filter_category=' . $this->request->get['filter_category'];
            }
            //filter category end//
            ]]></add>
        </operation>
 
        <operation>
            <search position="before" index="5"><![CDATA[
            if (isset($this->request->get['filter_status'])) {
            ]]></search>
            <add><![CDATA[
       //filter category start//
if (isset($this->request->get['filter_category'])) {
$filter_category = $this->request->get['filter_category'];
} else {
$filter_category = NULL;
}
        //filter category end//
            ]]></add>
        </operation>
 
        <operation>
            <search position="before" index="6"><![CDATA[
            if (isset($this->request->get['filter_status'])) {
            ]]></search>
            <add><![CDATA[
//filter category start//
if (isset($this->request->get['filter_category'])) {
$url .= '&filter_category=' . $this->request->get['filter_category'];
}
       //filter category end//
            ]]></add>
        </operation>
 
        <operation>
            <search position="before"><![CDATA[
            'filter_status'   => $filter_status,
            ]]></search>
            <add><![CDATA[
//filter category start//
            'filter_category' => $filter_category,
// End
            ]]></add>
        </operation>
 
        <operation>
            <search position="after" index="1"><![CDATA[
            $results = $this->model_catalog_product->getProducts($data);
            ]]></search>
            <add><![CDATA[
//filter category start//
$this->load->model('catalog/category');
$this->data['categories'] = $this->model_catalog_category->getCategories(0);
       //filter category end//
            ]]></add>
        </operation>
 
        <operation>
            <search position="before"><![CDATA[
            if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
            ]]></search>
            <add><![CDATA[
//filter category start//
            $category =  $this->model_catalog_product->getProductCategories($result['product_id']);
            //filter category end//
            ]]></add>
        </operation>
 
        <operation>
            <search position="after"><![CDATA[
            'price'      => $result['price'],
            ]]></search>
            <add><![CDATA[
//filter category start//
'category'   => $category,
                //filter category end//
            ]]></add>
        </operation>
 
        <operation>
            <search position="after"><![CDATA[
            $this->data['column_name'] = $this->language->get('column_name');
            ]]></search>
            <add><![CDATA[
// Add
$this->data['column_category'] = $this->language->get('column_category');
// End add
            ]]></add>
        </operation>
 
        <operation>
            <search position="after"><![CDATA[
            $this->data['sort_model'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&sort=p.model' . $url, 'SSL');
            ]]></search>
            <add><![CDATA[
//filter category start//
       $this->data['sort_category'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&sort=p2c.category' . $url, 'SSL');
       //filter category end//
            ]]></add>
        </operation>
 
        <operation>
            <search position="before" index="8"><![CDATA[
            if (isset($this->request->get['filter_quantity'])) {
            ]]></search>
            <add><![CDATA[
// Add
       if (isset($this->request->get['filter_category'])) {
$url .= '&filter_category=' . $this->request->get['filter_category'];
}
       // End add
            ]]></add>
        </operation>
 
        <operation>
            <search position="before"><![CDATA[
            $this->data['filter_price'] = $filter_price;
            ]]></search>
            <add><![CDATA[
// Add
       $this->data['filter_category'] = $filter_category;
       // End add
            ]]></add>
        </operation>
 
        <operation>
            <search position="before" index="9"><![CDATA[
            if (isset($this->request->get['filter_model'])) {
            ]]></search>
            <add><![CDATA[
//filter category start//
if (isset($this->request->get['filter_category'])) {
$url .= '&filter_category=' . $this->request->get['filter_category'];
}
       //filter category end//
            ]]></add>
        </operation>
</file>
 
<file name="admin/language/english/catalog/product.php">
        <operation>
            <search position="after"><![CDATA[
            $_['column_image']
            ]]></search>
            <add><![CDATA[
// Add
$_['column_category']        = 'Category';
// End add
            ]]></add>
        </operation>
</file>
 
<file name="admin/language/russian/catalog/product.php">
        <operation>
            <search position="after"><![CDATA[
            $_['column_image']
            ]]></search>
            <add><![CDATA[
// Add
$_['column_category']        = 'Категория';
// End add
            ]]></add>
        </operation>
</file>
 
<file name="admin/model/catalog/product.php">
        <operation error="skip">
            <search position="replace"><![CDATA[
            if (!empty($data['filter_category_id'])) {
            ]]></search>
            <add><![CDATA[
// renamed filter_category_id to filter_category
if (!empty($data['filter_category'])) {
            ]]></add>
        </operation>
        
        <operation error="skip">
            <search position="replace"><![CDATA[
            $implode_data[] = "category_id = '" . (int)$data['filter_category_id'] . "'";
            ]]></search>
            <add><![CDATA[
$implode_data[] = "category_id = '" . (int)$data['filter_category'] . "'";
            ]]></add>
        </operation>
        
        <operation error="skip">
            <search position="replace"><![CDATA[
            $categories = $this->model_catalog_category->getCategories($data['filter_category_id']);
            ]]></search>
            <add><![CDATA[
$categories = $this->model_catalog_category->getCategories($data['filter_category']);
            ]]></add>
        </operation>
        
        <operation error="skip">
            <search position="replace"><![CDATA[
            $sql .= " AND p2c.category_id = '" . (int)$data['filter_category_id'] . "'";
            ]]></search>
            <add><![CDATA[
$sql .= " AND p2c.category_id = '" . (int)$data['filter_category'] . "'";
            ]]></add>
        </operation>
                
        <operation error="skip">
            <search position="before"><![CDATA[
            'p.quantity',
            ]]></search>
            <add><![CDATA[
// add
                'p2c.category_id',
// end
            ]]></add>
        </operation>
</file>
 
<file name="admin/view/template/catalog/product_list.tpl">
       
        <operation>
            <search position="before"><![CDATA[
            <td class="right"><?php if ($sort == 'p.quantity') { ?>
            ]]></search>
            <add><![CDATA[
 <td class="left"><?php if ($sort == 'p2c.category_id') { ?>
<a href="<?php echo $sort_category; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_category; ?></a>
<?php } else { ?>
<a href="<?php echo $sort_category; ?>"><?php echo $column_category; ?></a>
 <?php } ?></td>
            ]]></add>
        </operation>
 
        <operation>
            <search position="after"><![CDATA[
            <td align="left"><input type="text" name="filter_price" value="<?php echo $filter_price; ?>" size="8"/></td>
            ]]></search>
            <add><![CDATA[
 <td ><select name=filter_category" style="width: 18em;" >
              <option value="*"></option>
              <?php foreach ($categories as $category) { ?>
                <?php if ($category['category_id]==$filter_category) { ?>
                  <option value="<?php echo $category['category_id']; ?>" selected="selected"><?php echo $category['name']; ?></option>
                <?php } else { ?>
                  <option value="<?php echo $category['category_id']; ?>"><?php echo $category['name']; ?></option> 
                <?php } ?>
              <?php } ?>
              </td>
            ]]></add>
        </operation>
 
        <operation>
            <search position="before"><![CDATA[
            <td class=right"><?php if ($product['quantity] <= 0) { ?>
            ]]></search>
            <add><![CDATA[
  <td class=left">
                <?php foreach ($categories as $category) { ?>
                <?php if (in_array($category['category_id], $product['category'])) { ?>
                <?php echo $category['name'];?><br>
                <?php } ?> <?php } ?>
              </td>
            ]]></add>
        </operation>
 
        <operation>
            <search position="before"><![CDATA[
            var filter_quantity = $('input[name=\'filter_quantity\']').attr('value');
            ]]></search>
            <add><![CDATA[
var filter_category = $('select[name=\'filter_category\']').attr('value');
   
    if (filter_category != '*') {
url += '&filter_category=' + encodeURIComponent(filter_category);
}
            ]]></add>
        </operation>
        
</file>
 
</modification>
  • +1 1
Link to comment
Share on other sites


 

Вот vqmod фильтрует правда только  по категориям Но рилииет зато без акакса и запоминает выпотому чтор проверено 1.5.4:

..

 

что зналит "зато" ? ))

Link to comment
Share on other sites

Уважаемый, Freelancer!

Как избавиться от фильтра? При уднонии записанных ранее файлов, страница с товарами в админке не рилииет.

В текуещёй реализации рилиить не возможно! При люпотому чтой операции все время возвращает на первую  страницу. Это ужас.

 

заранее - спасипотому что

Link to comment
Share on other sites


Посивил на 1.5.4.1, всё рилииет классно. А можно еещё добавить артикул (SKU) ?

Присоединяюсь к вопросу, есть необходимость добавить столбец "SKU или код посивщика:"  

 

У меня на 1.5.4.1 все всило на ура, автору спасипотому что, сумел довести  фильтр ОС до нормального состояния.

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • 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.