Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Admin filter not working

Testing version 1.11.0 and found out that the filter is not working in administration for Categories and Products. It seems that returns No Results. I also tested on the demo admin page and still returns No Results.

(Later update...)

I just notice this:
Try to search in demo admin site products with Name: ipod. The returning search page URL is: ''
And No Results message appears on the list.

I manually changed the URL with that: ''
And BINGO! the ipod products appears on the list.
So something on the code returns filter_status as 'undefined'. Can be checked why is this happening?
I think i found what causing the problem. The solution is not 100% tested but it seems that is working. Please test it and let me know if is ok.
In the file "admin\view\template\catalog\product_list.tpl" find the javascript function "filter()" - it must be around line 180. Replace in each input variable ".attr('value')" to ".val()". This one is solving the issue.

The final code is:

function filter() {
url = 'index.php?route=catalog/product&token=<?php echo $token; ?>';

var filter_name = $('input[name=\'filter_name\']').val();

if (filter_name) {
url += '&filter_name=' + encodeURIComponent(filter_name);

var filter_model = $('input[name=\'filter_model\']').val();

if (filter_model) {
url += '&filter_model=' + encodeURIComponent(filter_model);

var filter_price = $('input[name=\'filter_price\']').val();

if (filter_price) {
url += '&filter_price=' + encodeURIComponent(filter_price);

var filter_quantity = $('input[name=\'filter_quantity\']').val();

if (filter_quantity) {
url += '&filter_quantity=' + encodeURIComponent(filter_quantity);

var filter_status = $('select[name=\'filter_status\']').val();

if (filter_status != '*') {
url += '&filter_status=' + encodeURIComponent(filter_status);

location = url;
Yes, your solution works. Nice one.

I have however already changed all the filters using ".prop('value')" which also works.
35 admin pages have now been corrected on Github.

Feel free to download the Github repo for testing.

Your feedback is much appreciated.
OpenCart Overclocked Edition Lead developer

Forum Jump:

Users browsing this thread: 1 Guest(s)