Zen Cart Logo
Forums / Addon Sideboxes / Dynamic Filter [Support Thread]

Dynamic Filter [Support Thread]

Views: 652,529

Results 621 to 640 of 809
30 Jul 2015, 1:57 PM
#621
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Dynamic Filter [Support Thread]

kwright:

Greetings,

Thinking it would be a good feature, I would like to add an additional "Narrow Results By Products In Stock" feature to the sidebox. Looking through the tpl_dynamic_filter.php file, I'm a bit confused as to where and how I would add this?

Code suggestions?

Thanks

I am not sure I understand what you need.

30 Jul 2015, 5:25 PM
#622
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

I am not sure I understand what you need.

Hi Design75,

In our store, when a product is out of stock, it will show an Out of Stock button.

Our customers are not always interested in what is out of stock, just what is in stock. So, in our advanced search form, I have added a checkbox (Only Show In Stock Products) to limit results based on products that are in stock.

I would like to replace this with a similar function within the Dynamic Filters sidebox.

Thanks and I hope that clarifies! :D

30 Jul 2015, 5:29 PM
#623
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Dynamic Filter [Support Thread]

kwright:

Hi Design75,

In our store, when a product is out of stock, it will show an Out of Stock button.

Our customers are not always interested in what is out of stock, just what is in stock. So, in our advanced search form, I have added a checkbox (Only Show In Stock Products) to limit results based on products that are in stock.

I would like to replace this with a similar function within the Dynamic Filters sidebox.

Thanks and I hope that clarifies! :D

Understood, I'll will give it a try, but I am not near my computer until Monday.

30 Jul 2015, 5:58 PM
#624
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Much appreciated Design75! If you do give it a go, I may not be available to test until the following Sunday, August 2nd.

Thanks again!

2 Aug 2015, 6:23 PM
#625
jvrossem avatar

jvrossem

New Zenner

Join Date:
Apr 2015
Location:
Netherlands
Posts:
24
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Hello,

I just installed this module on my zencart 1.5.4. It don't work how it supposed to be yet.
De Filter itself shows ok on the left colum. Only when a filter get selected it wont apply the filter. All products just displays as before the filter.
The same goes for the Price filter.

Only when a filter has only 1 product the filters directs directly to this product (like it should be).

I dont have a clue how to cerrect this problem and hope someone can help me.

I got on my logs this error:

[02-Aug-2015 20:14:40 Europe/Amsterdam] PHP Warning:  array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/modules/edify/dynamic_filter.php on line 16[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/modules/edify/dynamic_filter.php on line 16[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 438[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 439[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 453[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 438[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 439[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 453[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 438[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 439[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 453[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 438[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 439[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 453[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning:  array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 473
3 Aug 2015, 12:46 PM
#626
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Dynamic Filter [Support Thread]

JvRossem:

Hello,

I just installed this module on my zencart 1.5.4. It don't work how it supposed to be yet.
De Filter itself shows ok on the left colum. Only when a filter get selected it wont apply the filter. All products just displays as before the filter.
The same goes for the Price filter.

Only when a filter has only 1 product the filters directs directly to this product (like it should be).

I dont have a clue how to cerrect this problem and hope someone can help me.

I got on my logs this error:

[02-Aug-2015 20:14:40 Europe/Amsterdam] PHP Warning: array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/modules/edify/dynamic_filter.php on line 16[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/modules/edify/dynamic_filter.php on line 16[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 438[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 439[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 453[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 438[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 439[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 453[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 438[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 439[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 453[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 438[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 439[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 453[02-Aug-2015 20:14:41 Europe/Amsterdam] PHP Warning: array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 473


I do not know the answer, but when I go to your site I get a white page.
Did you copy/merge all the files?
3 Aug 2015, 2:33 PM
#627
jvrossem avatar

jvrossem

New Zenner

Join Date:
Apr 2015
Location:
Netherlands
Posts:
24
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

I do not know the answer, but when I go to your site I get a white page.
Did you copy/merge all the files?
I did merge all the files. The white page was i litle mistake on my site:). The page should be up again now.

I think the problem is related to ultimate seo urls module. Because when a filter is applayed i see in the url only =Array, instead of the filter.

At the moment i have the filter only showing up in 3 categories. I dont need it on the other categorys since they dont have attributes, end this mod brakes the page when there are no attributes.

So it seems like the module is filtering the producte, but seo change the urls wrong. Any idea how to fix this?

3 Aug 2015, 2:44 PM
#628
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Dynamic Filter [Support Thread]

JvRossem:

I did merge all the files. The white page was i litle mistake on my site:). The page should be up again now.

I think the problem is related to ultimate seo urls module. Because when a filter is applayed i see in the url only =Array, instead of the filter.

At the moment i have the filter only showing up in 3 categories. I dont need it on the other categorys since they dont have attributes, end this mod brakes the page when there are no attributes.

So it seems like the module is filtering the producte, but seo change the urls wrong. Any idea how to fix this?

Not at the moment, I do not use ultimate seo urls.

3 Aug 2015, 3:24 PM
#629
jvrossem avatar

jvrossem

New Zenner

Join Date:
Apr 2015
Location:
Netherlands
Posts:
24
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

Not at the moment, I do not use ultimate seo urls.
I just tested without seo urls, still same result. So i gues its not the problem.
If u look at the error code it seems he can't find the right parameter:

[03-Aug-2015 17:18:16 Europe/Amsterdam] PHP Warning:  array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/modules/edify/dynamic_filter.php on line 16[03-Aug-2015 17:18:16 Europe/Amsterdam] PHP Warning:  array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/modules/edify/dynamic_filter.php on line 16[03-Aug-2015 17:18:17 Europe/Amsterdam] PHP Warning:  array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 240[03-Aug-2015 17:18:17 Europe/Amsterdam] PHP Warning:  array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 241[03-Aug-2015 17:18:17 Europe/Amsterdam] PHP Warning:  in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 245[03-Aug-2015 17:18:17 Europe/Amsterdam] PHP Warning:  in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 245[03-Aug-2015 17:18:17 Europe/Amsterdam] PHP Warning:  in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 325

This is a fraction from the error code, the list and lines goes on.

This is the page with the filter: http://www.restyleparts.com/18-inch-c-10_5834_5836/

3 Aug 2015, 4:02 PM
#630
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Dynamic Filter [Support Thread]

JvRossem:

I just tested without seo urls, still same result. So i gues its not the problem.
If u look at the error code it seems he can't find the right parameter:

[03-Aug-2015 17:18:16 Europe/Amsterdam] PHP Warning: array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/modules/edify/dynamic_filter.php on line 16[03-Aug-2015 17:18:16 Europe/Amsterdam] PHP Warning: array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/modules/edify/dynamic_filter.php on line 16[03-Aug-2015 17:18:17 Europe/Amsterdam] PHP Warning: array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 240[03-Aug-2015 17:18:17 Europe/Amsterdam] PHP Warning: array_filter() expects parameter 1 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 241[03-Aug-2015 17:18:17 Europe/Amsterdam] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 245[03-Aug-2015 17:18:17 Europe/Amsterdam] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 245[03-Aug-2015 17:18:17 Europe/Amsterdam] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/shopuu3331/domains/restyleparts.com/public_html/includes/templates/edify/sideboxes/tpl_dynamic_filter.php on line 325

> This is a fraction from the error code, the list and lines goes on.
> 
> This is the page with the filter: <http://www.restyleparts.com/18-inch-c-10_5834_5836/>

Does it also happen when you use other filter styles? like checkbox?
This is very hard to debug without seeing the actual files.
If you are okay with it I could take a look at your files through ftp, if so send me a pm.
12 Aug 2015, 3:02 PM
#631
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

Understood, I'll will give it a try, but I am not near my computer until Monday.

Good day Design75,

I'm back in town. Just wondering if you had a chance to look at adding a filter by In Stock items feature?

Thanks :D

15 Aug 2015, 2:28 PM
#632
raj_ics avatar

raj_ics

New Zenner

Join Date:
Jul 2015
Location:
Hyderabad
Posts:
6
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I have tried installing this plugin on a Zen Cart version 1.5.4
Have followed all the instructions in the documentation when setting it up. I was using Ultimate SEO URL's, so disabled it.
Still cannot get this to work. Any suggestions?
http://dev.vincoshooters.com/index.php?main_page=index&cPath=442_737

Thank You

27 Aug 2015, 4:05 PM
#633
raj_ics avatar

raj_ics

New Zenner

Join Date:
Jul 2015
Location:
Hyderabad
Posts:
6
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

This the SQL query I ran to get the products filter to work.

Update products set products_price_sorter = products_price WHERE 1

9 Sep 2015, 8:38 PM
#634
mikey_d avatar

mikey_d

New Zenner

Join Date:
Jan 2012
Location:
Canada
Posts:
16
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Heeeeyyyy!
So I got it installed and working with only a few hiccups. One being the SQL install code not taking into consideration extra columns in my database. I had to add "NULL" to the end of each insert to get it in there and add the "zen_" prefix to the table names. Then using the git hub version of the plugin, it installed correctly and it didn't do that thing where it messes up the CSS in categories with no attributes.
But now I'm running into a funny bug.
You can see it yourself on this page: http://www.firstcallautosupply.com/fasteners/stainless-steel-fasteners/standard-socket-head-cap-screws

Let's say you try sorting it by bolt width #6. It looks great!
But try sorting it by bolt width 1/4", and you get no results.:huh:
What's weird is that this seems to only be a problem with the standard bolts, which obviously isn't the bolts fault.
Playing around with it just now, I think it's having a problem with the quotation mark. That seems to be the only constant when it's not showing results.
Could someone help me with a fix for this?

9 Sep 2015, 10:41 PM
#635
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Dynamic Filter [Support Thread]

Mikey D:

Heeeeyyyy!
So I got it installed and working with only a few hiccups. One being the SQL install code not taking into consideration extra columns in my database. I had to add "NULL" to the end of each insert to get it in there and add the "zen_" prefix to the table names. Then using the git hub version of the plugin, it installed correctly and it didn't do that thing where it messes up the CSS in categories with no attributes.
But now I'm running into a funny bug.
You can see it yourself on this page: http://www.firstcallautosupply.com/fasteners/stainless-steel-fasteners/standard-socket-head-cap-screws

Let's say you try sorting it by bolt width #6. It looks great!
But try sorting it by bolt width 1/4", and you get no results.:huh:
What's weird is that this seems to only be a problem with the standard bolts, which obviously isn't the bolts fault.
Playing around with it just now, I think it's having a problem with the quotation mark. That seems to be the only constant when it's not showing results.
Could someone help me with a fix for this?

Interesting :wacko: It indeed looks like it has something to do with the quotation marks. I will give it a try tomorrow on my test site.

10 Sep 2015, 10:26 AM
#636
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Dynamic Filter [Support Thread]

Design75:

Interesting :wacko: It indeed looks like it has something to do with the quotation marks. I will give it a try tomorrow on my test site.

I tried on my test site this morning and all works as supposed.
I added an option value to one of the products wit a value of 4" , and when I filter on that value, 2 products(which i gave the attribute) show up.
After that I added a 1/4" attribute, and that where it get interesting, because all the attribute counts show up as 1, although the filtering still work as it should be. I will need to investigate this further.

12 Sep 2015, 2:47 PM
#637
justrimless avatar

justrimless

Zen Follower

Join Date:
Aug 2006
Posts:
127
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

This is working great except for one peculiarity.

Since installing it I can filter fine on existing attributes, however if I add new ones, and try to filter, the option is visible and the product count is correct but selecting the option returns no results?

Any idea why this might be the case? I suppose I could install it again but would rather not in case i've tweaked any files since.

14 Sep 2015, 5:13 PM
#638
justrimless avatar

justrimless

Zen Follower

Join Date:
Aug 2006
Posts:
127
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

And is there a way to prevent read only attributes from showing up?

14 Sep 2015, 5:51 PM
#639
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Dynamic Filter [Support Thread]

Justrimless:

And is there a way to prevent read only attributes from showing up?

Yes there is. And a similar thing was already in a test version for "text" and "file" types

locate includes/modules/sideboxes/YOUR_TEMPLATE/dynamic_filter.php and find the lines

    $attributes = $db->Execute("SELECT count(DISTINCT p2a.products_id) AS quantity, po.products_options_name, pov.products_options_values_name,
                                SUM(IF(p2a.products_id IN(" . implode(',', $filteredProducts) . "), 1, 0)) AS flag
                                FROM " . TABLE_PRODUCTS_ATTRIBUTES . " p2a
                                JOIN " . TABLE_PRODUCTS_OPTIONS . " po ON p2a.options_id = po.products_options_id
                                AND po.language_id=" . (int)$_SESSION['languages_id'] . "
                                JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov ON p2a.options_values_id = pov.products_options_values_id
                                AND pov.language_id=" . (int)$_SESSION['languages_id'] .
                                (defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? "
                                  JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as ON p2a.products_id = p2as.products_id
                                  AND p2as.stock_attributes LIKE CONCAT('%', p2a.products_attributes_id, '%')" : "") . "
                                WHERE p2a.products_id IN (" . implode(',', $unfilteredProducts) . ")" . 
                                (FILTER_OPTIONS_INCLUDE != '' ? " AND p2a.options_id IN (" . FILTER_OPTIONS_INCLUDE . ")" : '') .
                                (FILTER_OPTIONS_EXCLUDE != '' ? " AND p2a.options_id NOT IN (" . FILTER_OPTIONS_EXCLUDE . ")" : '') .
                                (defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? "
                                  AND p2as.quantity > 0" : "") . "
                                GROUP BY po.products_options_name, pov.products_options_values_name
                                ORDER BY po.products_options_name, pov.products_options_values_sort_order");

and change them to

    $attributes = $db->Execute("SELECT count(DISTINCT p2a.products_id) AS quantity, po.products_options_name, pov.products_options_values_name,
                                SUM(IF(p2a.products_id IN(" . implode(',', $filteredProducts) . "), 1, 0)) AS flag
                                FROM " . TABLE_PRODUCTS_ATTRIBUTES . " p2a
                                JOIN " . TABLE_PRODUCTS_OPTIONS . " po ON p2a.options_id = po.products_options_id
                                AND po.language_id=" . (int)$_SESSION['languages_id'] . "
                                JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov ON p2a.options_values_id = pov.products_options_values_id
                                AND pov.language_id=" . (int)$_SESSION['languages_id'] .
                                (defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? "
                                  JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as ON p2a.products_id = p2as.products_id
                                  AND p2as.stock_attributes LIKE CONCAT('%', p2a.products_attributes_id, '%')" : "") . "
                                WHERE p2a.products_id IN (" . implode(',', $unfilteredProducts) . ")" . 
                                (FILTER_OPTIONS_INCLUDE != '' ? " AND p2a.options_id IN (" . FILTER_OPTIONS_INCLUDE . ")" : '') .
                                (FILTER_OPTIONS_EXCLUDE != '' ? " AND p2a.options_id NOT IN (" . FILTER_OPTIONS_EXCLUDE . ")" : '') .
                                (defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? "
                                  AND p2as.quantity > 0" : "") . "
                                AND po.products_options_type != '1'
                                AND po.products_options_type != '4'
                                GROUP BY po.products_options_name, pov.products_options_values_name
                                ORDER BY po.products_options_name, pov.products_options_values_sort_order");

this eliminates file and text.

If you want to add readonly to that list:

    $attributes = $db->Execute("SELECT count(DISTINCT p2a.products_id) AS quantity, po.products_options_name, pov.products_options_values_name,
                                SUM(IF(p2a.products_id IN(" . implode(',', $filteredProducts) . "), 1, 0)) AS flag
                                FROM " . TABLE_PRODUCTS_ATTRIBUTES . " p2a
                                JOIN " . TABLE_PRODUCTS_OPTIONS . " po ON p2a.options_id = po.products_options_id
                                AND po.language_id=" . (int)$_SESSION['languages_id'] . "
                                JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov ON p2a.options_values_id = pov.products_options_values_id
                                AND pov.language_id=" . (int)$_SESSION['languages_id'] .
                                (defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? "
                                  JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as ON p2a.products_id = p2as.products_id
                                  AND p2as.stock_attributes LIKE CONCAT('%', p2a.products_attributes_id, '%')" : "") . "
                                WHERE p2a.products_id IN (" . implode(',', $unfilteredProducts) . ")" . 
                                (FILTER_OPTIONS_INCLUDE != '' ? " AND p2a.options_id IN (" . FILTER_OPTIONS_INCLUDE . ")" : '') .
                                (FILTER_OPTIONS_EXCLUDE != '' ? " AND p2a.options_id NOT IN (" . FILTER_OPTIONS_EXCLUDE . ")" : '') .
                                (defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? "
                                  AND p2as.quantity > 0" : "") . "
                                AND po.products_options_type != '1'
                                AND po.products_options_type != '4'
                                AND po.products_options_type != '5'
                                GROUP BY po.products_options_name, pov.products_options_values_name
                                ORDER BY po.products_options_name, pov.products_options_values_sort_order");
15 Sep 2015, 8:25 AM
#640
justrimless avatar

justrimless

Zen Follower

Join Date:
Aug 2006
Posts:
127
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

Yes there is. And a similar thing was already in a test version for "text" and "file" types

locate includes/modules/sideboxes/YOUR_TEMPLATE/dynamic_filter.php and find the lines.......

Many thanks.