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

Dynamic Filter [Support Thread]

Views: 652,529

Results 661 to 680 of 809
5 Jun 2016, 10:54 AM
#661
design75 avatar

design75

Totally Zenned

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

Dynamic Filter [Support Thread]

LadyoftheCave:

When I tried to install the SQL patch, I received the following error, do you happen to know what I can do to fix this?

Succes 9 statements processed.
Foutmelding ERROR: adding "configuration_key" "" wasn't possible because it already exists.
Foutmelding ERROR: adding "configuration_key" "" wasn't possible because it already exists.
Foutmelding ERROR: adding "configuration_key" "" wasn't possible because it already exists.
Waarschuwing Note: 1 statements ignored. See "upgrade_exceptions" table for additional details.


This is telling you that some keys already existed, and skipped those. So you should be fine.
 Does the mod work?
5 Jun 2016, 11:02 AM
#662
ladyofthecave avatar

ladyofthecave

Zen Follower

Join Date:
Jan 2016
Location:
Netherlands
Posts:
150
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

This is telling you that some keys already existed, and skipped those. So you should be fine.
Does the mod work?

Unfortunatelly it wasn't working. I will try again (had removed it from my computer because it wasn't working) and I will let you know what the errors are..

Thank you..

5 Jun 2016, 11:32 AM
#663
ladyofthecave avatar

ladyofthecave

Zen Follower

Join Date:
Jan 2016
Location:
Netherlands
Posts:
150
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Hi again Design75. I have installed the Dynamic filter again. I have switched it on at the layout boxes controller, but when I go to Admin -> Configuration -> Dynamic Filter. Then I only see an empty page (see picture)

Attachment 16400

6 Jun 2016, 11:25 AM
#664
design75 avatar

design75

Totally Zenned

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

Re: Dynamic Filter [Support Thread]

LadyoftheCave:

Hi again Design75. I have installed the Dynamic filter again. I have switched it on at the layout boxes controller, but when I go to Admin -> Configuration -> Dynamic Filter. Then I only see an empty page (see picture)

Attachment 16400

I suspect that the configuration id's in the database are different from the id set for dynamic filter. You probably should try a manual edit in phpmyadmin, and match the id's
Find in the table admin_pages what the number is that is set in gID=##. Then go to the table configuration and set this number in each configuration_group_id for the dynamic filter settings

7 Jun 2016, 8:43 AM
#665
ladyofthecave avatar

ladyofthecave

Zen Follower

Join Date:
Jan 2016
Location:
Netherlands
Posts:
150
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Thank you :) I am going to try this now..

7 Jun 2016, 9:04 AM
#666
ladyofthecave avatar

ladyofthecave

Zen Follower

Join Date:
Jan 2016
Location:
Netherlands
Posts:
150
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

It is working now, thank you :)

7 Jun 2016, 10:37 AM
#667
design75 avatar

design75

Totally Zenned

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

Re: Dynamic Filter [Support Thread]

LadyoftheCave:

It is working now, thank you :)

Thanks for reporting back, and I am glad it is working now

7 Jun 2016, 2:24 PM
#668
ladyofthecave avatar

ladyofthecave

Zen Follower

Join Date:
Jan 2016
Location:
Netherlands
Posts:
150
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Hi again :smile:,

I thought that everything was working now, but when I click on by price, everything is working, but if I click on by colour, then I receive an error:

WARNING: An Error occurred, please refresh the page and try again.

Log file:

[07-Jun-2016 11:09:38 Europe/Amsterdam] PHP Fatal error:  1267:Illegal mix of collations (latin1_swedish_ci,COERCIBLE) 
and (latin1_bin,NONE) for operation 'find_in_set' :: SELECT DISTINCT  p.products_id, p.products_type, p.master_categories_id,
       
p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1,
       
s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status =1, s.specials_new_products_price,
       
p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping,
       
p.products_qty_box_status FROM products p LEFT JOIN specials s on p.products_id = s.products_id LEFT JOIN products_description pd on 
p.products_id = pd.products_id JOIN products_to_categories p2c on p.products_id = p2c.products_id JOIN products_attributes p2a on 
p.products_id = p2a.products_id JOIN products_options po on p2a.options_id = po.products_options_id JOIN products_options_values 
pov on p2a.options_values_id = pov.products_options_values_id WHERE p.products_status = 1
       and pd.language_id = '2'
       
and p2c.categories_id = '457' and (p.products_price_sorter>=5.28 and p.products_price_sorter<=15) GROUP BY p.products_id 
HAVING ( FIND_IN_SET("Kleurbruin/naturel", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), 
pov.products_options_values_name)))) ==> (as called by) /var/www/vhosts/merlins-cave.nl/httpdocs/xdatabasesite/includes/modules/pages/
index/header_php.php on line 52 <== in /var/www/vhosts/merlins-cave.nl/httpdocs/xdatabasesite/includes/classes/db/mysql/query_factory.php on line 155
7 Jun 2016, 2:36 PM
#669
design75 avatar

design75

Totally Zenned

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

Re: Dynamic Filter [Support Thread]

You have different collations in your database. This is causing the error. You should change them all to latin1_swedish_ci.

9 Jun 2016, 2:46 AM
#670
brian70809 avatar

brian70809

New Zenner

Join Date:
Jun 2011
Posts:
85
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I love what this filter can do, but I want it to behave exactly like the first post website http://www.snowrepublic.co.uk/.....

Is this even the same mod, the post is from 2012? I want to be able to check multiple boxes and it filters as they are checked and unchecked... So it's responding immediately to inputs instead of waiting to click the filter button. Is there is an option for it to do this?

I am sure I can modify the code to do this, but before I do, I just want to make sure I'm not doing something incorrectly.

So I want it to behave like checkbox-single but actually allow for multiple inputs.

Thanks!

Brian

13 Jul 2016, 2:07 PM
#671
tmacarle avatar

tmacarle

New Zenner

Join Date:
Sep 2011
Posts:
19
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Hi, I am wondering if anyone can help me. I do like the dynamic filter however, it causes my manufacturer/category & alpha sort filters (built in) to not work at all. I am using zencart 1.5.1 and have winchester black template by picaflor installed. The dynamic filter works perfectly (I installed the code around the modified files manually), but now the built in filters do not work at all. I am in need of having a "category" filter otherwise I must uninstall this mod as this is crucial for my particular site. Thanks.

14 Jul 2016, 3:22 AM
#672
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Hi. You had given me a great suggestion a while ago about how to filter the products on my website by different food allergies: gluten free, nut free, etc. I have created an Option Name of Allergies (display-only), with Option Values of: Gluten Free, Tree Nut Free, Peanut Free, and Lactose Free. I have put the Allergies attribute on 2 products in the Snacks category.

  1. Don't Go Nuts Blueberry Blast is: Gluten Free, Peanut Free, and Tree Nut Free.
  2. Monk Pack Apple Quinoa is: Gluten Free and Lactose Free.
    I'm using the multiple checkboxes style. People might have multiple allergies, so if I check both Gluten Free and Lactose Free, I would expect that only the Monk Pack Apple Quinoa product would be returned, since it is the only product that has both options set. However, it is returning both of the products. I think it must be returning all products that have either of these options set, but instead, I want it to return only the products that have both of these options set. Is there any way for me to get that to happen?

In case you want to see it in action, I have this running on my test site, test "dot" kosher4health "dot" com. You can go to the snacks category to see it work.

Thanks very much for any help with this! It's a great mod, and I know it will be a great addition to my site.

14 Jul 2016, 3:25 PM
#673
design75 avatar

design75

Totally Zenned

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

Re: Dynamic Filter [Support Thread]

:bigups:> earth-friendly:

Hi. You had given me a great suggestion a while ago about how to filter the products on my website by different food allergies: gluten free, nut free, etc. I have created an Option Name of Allergies (display-only), with Option Values of: Gluten Free, Tree Nut Free, Peanut Free, and Lactose Free. I have put the Allergies attribute on 2 products in the Snacks category.

  1. Don't Go Nuts Blueberry Blast is: Gluten Free, Peanut Free, and Tree Nut Free.
  2. Monk Pack Apple Quinoa is: Gluten Free and Lactose Free.
    I'm using the multiple checkboxes style. People might have multiple allergies, so if I check both Gluten Free and Lactose Free, I would expect that only the Monk Pack Apple Quinoa product would be returned, since it is the only product that has both options set. However, it is returning both of the products. I think it must be returning all products that have either of these options set, but instead, I want it to return only the products that have both of these options set. Is there any way for me to get that to happen?

In case you want to see it in action, I have this running on my test site, test "dot" kosher4health "dot" com. You can go to the snacks category to see it work.

Thanks very much for any help with this! It's a great mod, and I know it will be a great addition to my site.

I am on vacation right now, but as soon as I'm back (2 asks)I will take a look. Or else please remind me.

17 Jul 2016, 6:17 AM
#674
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

earth-friendly:

Hi. You had given me a great suggestion a while ago about how to filter the products on my website by different food allergies: gluten free, nut free, etc. I have created an Option Name of Allergies (display-only), with Option Values of: Gluten Free, Tree Nut Free, Peanut Free, and Lactose Free. I have put the Allergies attribute on 2 products in the Snacks category.

  1. Don't Go Nuts Blueberry Blast is: Gluten Free, Peanut Free, and Tree Nut Free.
  2. Monk Pack Apple Quinoa is: Gluten Free and Lactose Free.
    I'm using the multiple checkboxes style. People might have multiple allergies, so if I check both Gluten Free and Lactose Free, I would expect that only the Monk Pack Apple Quinoa product would be returned, since it is the only product that has both options set. However, it is returning both of the products. I think it must be returning all products that have either of these options set, but instead, I want it to return only the products that have both of these options set. Is there any way for me to get that to happen?

In case you want to see it in action, I have this running on my test site, test "dot" kosher4health "dot" com. You can go to the snacks category to see it work.

Thanks very much for any help with this! It's a great mod, and I know it will be a great addition to my site.

Design75, no need to look into this issue. I found a way to solve this problem.
I created each of these allergies as a separate Option Name, and each Option Name has a single Option Value.
So I have an Option Name: Gluten Free, and that Option has 1 Option Value, which I also call Gluten Free.
Then I have another Option Name: Peanut Free, and that Option has 1 Option Value, which I call Peanut Free, and so on.
Now, if you want to find products that are both Gluten Free and Peanut Free, you click on both checkboxes, and it does it correctly.
Previously, I just had one Option Name, Allergies, and a bunch of different Option Values for that option (Gluten Free, Peanut Free, etc.) When I clicked on 2 different option values, it found the products that were either Gluten Free or Peanut Free. I can understand that in some cases you might want this behavior. For example, if you have clothing that comes in different colors, you might want to find all clothes that are either red or purple. But in my case, I want to find products that are both Gluten Free and Peanut Free, so this solution seems to work well for that.
I fixed up the styling so that the option names don't display, and I tightened up the spacing.
I have implemented this on my live site, so you can see it working there if you'd like.
http://www.kosher4health.com .
Thanks again for a great mod! I think this will be very helpful for my customers. :smile:

17 Jul 2016, 8:12 AM
#675
design75 avatar

design75

Totally Zenned

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

Re: Dynamic Filter [Support Thread]

:thumbsup: glad you figured it out. I am sure it will help others.

18 Jul 2016, 5:25 AM
#676
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I have discovered a problem.
If you go to my website, http://www.kosher4health.com, and go to the "Snacks" category, and then click on the checkbox for "Gluten Free", and then at the top right, instead of going to the next page, click "View All",
then I get: "There are no products to list in this category." even though there are products.
There is a debug file, and it has a bunch of stuff, but I think the main thing is that it is trying to divide by zero in split_page_results.php, on line 100. (I can give you the complete debug file if that will be helpful.)
This is line 100: ```
$this->number_of_pages = ceil($this->number_of_rows / $this->number_of_rows_per_page);

This means that ```
$this->number_of_rows_per_page
``` is zero.
Higher up in the file we have:

$this->number_of_rows_per_page = $max_rows;

and a little above that we have:
if ($page == 'all') {
  $this->page_all = true;
  $override = $db->Execute($query);
  $max_rows = $override->RecordCount();
}
So it looks like the query is not returning any results.

I'm not sure where I should go from here. I could work in my test site, and turn on debugging for sql statements. Or, does anyone have any ideas about what might be going wrong and how to fix it?
I am using zen-cart 1.5.5a, and the Winchester Responsive template. 
I did my best to modify split_page_results.php for this mod, but there were some significant differences between this file and my version, probably because of both 1.5.5a and Winchester Responsive.
Thanks in advance for any help with this issue!
21 Jul 2016, 2:41 AM
#677
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

earth-friendly:

I have discovered a problem.
If you go to my website, http://www.kosher4health.com, and go to the "Snacks" category, and then click on the checkbox for "Gluten Free", and then at the top right, instead of going to the next page, click "View All",
then I get: "There are no products to list in this category." even though there are products.
There is a debug file, and it has a bunch of stuff, but I think the main thing is that it is trying to divide by zero in split_page_results.php, on line 100. (I can give you the complete debug file if that will be helpful.)
This is line 100: ```
$this->number_of_pages = ceil($this->number_of_rows / $this->number_of_rows_per_page);

> This means that ```
$this->number_of_rows_per_page
``` is zero.
> Higher up in the file we have:
> ```
$this->number_of_rows_per_page = $max_rows;

and a little above that we have:

if ($page == 'all') {
  $this->page_all = true;
  $override = $db->Execute($query);
  $max_rows = $override->RecordCount();
}
> So it looks like the query is not returning any results.
> 
> I'm not sure where I should go from here. I could work in my test site, and turn on debugging for sql statements. Or, does anyone have any ideas about what might be going wrong and how to fix it?
> I am using zen-cart 1.5.5a, and the Winchester Responsive template. 
> I did my best to modify split_page_results.php for this mod, but there were some significant differences between this file and my version, probably because of both 1.5.5a and Winchester Responsive.
> Thanks in advance for any help with this issue!

I have sort of figured this out, but not sure if my solution makes total sense.
The file I worked with is includes/modules/MYTEMPLATE/dynamic_filter.php
The issue seems to be in the HAVING part of the query:

$having .= ' FIND_IN_SET("' . $key . addslashes($value) . '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))';

When I go to my website and click on the snacks category,
<http://www.kosher4health.com/snacks-c-1.html>
and then I click on "Gluten Free" to filter by that, 
everything works fine. The value of $having at that point is:

HAVING (
FIND_IN_SET("GlutenFreeGluten Free", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))

However, if I then click on the "View All" link in the top right (instead of going to a particular page number), it says there are no products to list in this category. The query that is being run returns no records. And, the value of $having at that point is:

HAVING (
FIND_IN_SET("GlutenFreeGluten%20Free", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))

So in other words, the option value that it is searching for in the database, after clicking on "Gluten Free", is "Gluten Free".
But after clicking on "View All", the option value that it is searching for is "Gluten%20Free".

I also noticed that the urls are a bit strange:
After clicking on the checkbox for "Gluten Free", the url is:

http://www.mydomainname.com/snacks-c-1.html?main_page=index&cPath=1&fltGlutenFree%5B%5D=Gluten+Free

and after clicking on "View All", the url is:

http://www.mydomainname.com/snacks-c-1.html?fltGlutenFree%5B%5D=Gluten%2520Free&sort=20a&page=all

It looks like extra encoding happens during this process.

The solution I came up with in my test site is to remove both a space and "%20" in $value, and then in the db search, also remove spaces from the products_options_values_name, in the same way that spaces are being removed from the search on products_options_name.
So, I replaced :

$having .= ' FIND_IN_SET("' . $key . addslashes($value) . '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))';

with
      $having_value = str_replace(" ","",$value);
      $having_value = str_replace("%20","",$having_value);
      $having .= ' FIND_IN_SET("' . $key . addslashes($having_value) . '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), REPLACE(pov.products_options_values_name, " ", ""))))'
And now, after clicking on the checkbox for Gluten Free, the value of $having is:

HAVING (
FIND_IN_SET("GlutenFreeGlutenFree", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), REPLACE(pov.products_options_values_name, " ", ""))))

and after clicking on "View All", the value of $having is:

HAVING (
FIND_IN_SET("GlutenFreeGlutenFree", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), REPLACE(pov.products_options_values_name, " ", ""))))

I haven't put this on my live site yet. I was hoping that perhaps Design75, you could please look it over to make sure it is a reasonable change. 
Also, I wonder if anyone else has had this problem, or if it has to do with the template I am using.
Thanks in advance for your help with this!!
26 Jul 2016, 4:29 PM
#678
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Just to let you know, the changes described above didn't completely solve the problem. I found that if I filtered by "Gluten Free", and then clicked to go to page 2, then to page 3, it would still double encode the space in "Gluten Free" in the url, and I would end up with finding no results.
The solution I came up with had the following changes:

  1. In includes/modules/mytemplate/dynamic_filter.php
    Replace ```
    $having .= ' FIND_IN_SET("' . $key . addslashes($value) . '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))';
with ```
 // BOF LEFP fix to remove spaces before searching for attribute values
         $having_value = str_replace(" ","",$value);
         $having_value = str_replace("%20","",$having_value);
           $having .= ' FIND_IN_SET("' . $key . addslashes($having_value) . '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), REPLACE(pov.products_options_values_name, " ", ""))))';
// EOF LEFP fix
  1. In includes/templates/mytemplate/sideboxes/tpl_dynamic_filter.php
    Right before: ```
    if ($attributes->fields['products_options_values_name'] != $savValue)
add: ```
// BOF LEFP fix to remove spaces before searching for attribute values
         $value_without_spaces = str_replace(" ","",$attributes->fields['products_options_values_name']);

Then, everywhere within the "if" statement, replace

$attributes->fields['products_options_values_name']

with ```
$value_without_spaces

EXCEPT where we are actually printing it out, because we want "Gluten Free" to show up with the space on the page:

htmlspecialchars(html_entity_decode($attributes->fields['products_options_values_name'], ENT_QUOTES)) .' 

Also, replace ```
 $savValue = $attributes->fields['products_options_values_name'];

with ```
$savValue = $value_without_spaces;

Note: I am using the single checkbox method, so I only made those changes in my file, so I'm not sure if the changes are identical for the other methods.
Anyway, those are the changes I made, and it seems to work ok. I have it on my live site now, <http://www.kosher4health.com>. I'd love to hear comments about whether or not this change is ideal. I hope this helps someone :smile:
I'm still not sure if this was a problem for everyone, or just for me because of the template I am using. Perhaps everyone else has single-word attribute values, and I am the first person to have an attribute value with a space?
5 Aug 2016, 11:26 AM
#679
psychophrenic avatar

psychophrenic

New Zenner

Join Date:
Aug 2016
Location:
Greece
Posts:
3
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Good afternoon, and hello to all zen-guys! im new to zen-cart and one of my clients e-shop is on zen-cart 1.5.4. with the megashop template installed on it. I can see that the dynamic filter works on the special and feature page but it does not seem that it works on the categories and sub-category pages as requested. Can anyone help? the sites url is : http://eudatahost.com/heliland/catalog/index.php?main_page=index Thanxs in advance,

12 Aug 2016, 4:26 PM
#680
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I'm playing with this mod on my WAMP test site, zc 1.5.5a with Responsive Sheffiled Blue and many mods.

On the install.sql - the big chunk at the beginning of this file installs via phpMyAdmin. But I get error on the last bit for zencart 1.5 mods.

Specifically, the values for main_page_parms and sort order.

DELETE FROM zen_admin_pages WHERE page_key='configDynamicFilter';
INSERT INTO zen_admin_pages (page_key,language_key,main_page,page_params,menu_key,display_on_menu,sort_order) VALUES ('configDynamicFilter','BOX_CONFIGURATION_DYNAMIC_FILTER','FILENAME_CONFIGURATION',CONCAT('gID=',@cid), 'configuration', 'Y', @cid);  

My zen_config_group installed from the first part of sql has config group id and sort order of 2828. I tried substituting those values in place of the @cid, to no avail.

There are no extra columns in my zen_admin_pages.

Initial error msg was those values (as in install.sql) can't be null. Attempt to insert the 2828 gives syntax error.