Dynamic Filter - works on some categories, doesn't on others
We have installed the Dynamic Filter addon and think that it has great potential for our site. For some products, the filter works great and for others we have an issue. Since we are just testing functionality for our site, we have not yet added attributes to all of the products.
For example, filtering for mat boards seems to work fine. The trouble we are encountering is with wood molding (currently only 12 moldings have attributes added). Say we choose to filter by color and wish to look at the gold frames (there are 4 with attributes at this time). After applying the filter, the page comes up and says "Displaying 1 to 3 (of 3 products)" but then doesn't show any of the product information.
http://i45.tinypic.com/2vucw1w.jpg
This same thing happens regardless of which attribute (for wood molding) that is filtered. I have searched FAQ's and forum posts for this but haven't found anyone else with a similar issue. I checked my cache for errors and the only one that comes up is "PHP warning: strlen() expects parameter 1 to be string,...". In researching this issue, it seems to not be a big deal however I did try replacement code in functions_general.php as suggested. This however did not work for me since I am using a version of this file that has been modified for Dynamic Filter.
Any help in resolving this issue would be greatly appreciated. Thanks!
w w w . f r a m i n g s u p p l i e s - s h o p . c o m
using Zen Cart v1.5.0
Linux server
PHP 5.3.14
My SQL 5.1.65-cll
AddOns
FedEx
USPS
Backup_MySQL
IH4
Avonlee Contempo Template
Dynamic Filter
Re: Dynamic Filter - works on some categories, doesn't on others
While continuing to research this problem, I came across a forum thread that I had not found previously.
http://www.zen-cart.com/showthread.p...ng-for-Options
It seems like a problem that is similar to ours. So, I have attempted to follow the advice given in this post.
I added the 'die' statement to tpl_dynamic_filter.php and went to site to get the readout. This is what came up (with database prefix removed):
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 = '1' and p2c.categories_id = '3' GROUP BY p.products_id HAVING ( FIND_IN_SET("FrameColorFamilygold", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name))))
As suggested, I went to phpMyAdmin and entered this information into the SQL box. It returned this message "MySQL returned an empty result set (i.e. zero rows)."
This is not the same result as the person from the other thread. Does anyone have an idea as to how I should proceed? I will continue to try what was suggested in the other thread but I'm not really sure if it applies to me since I didn't get the same result.
Also, since the filter works on some categories and not others, we tried to think of reasons why this might be. The only difference we came up with is that the categories where the filter doesn't work have an attribute where pricing by attribute is applied. We have excluded this attribute from Dynamic Filter through the configuration menu in admin so I don't think that would be the problem but since I can't come up with anything else, I just wondered.
Thanks.
Re: Dynamic Filter - works on some categories, doesn't on others
I'm continuing to follow the instructions given in the forum thread that I mentioned in the last post but I'm still not sure how to proceed.
As suggested, I added the 'die' statement to product_listing.php (the one added by the template) to see if the number of rows returned by $listing_split is greater than zero. It came back as "I see 4".
I added another 'die' statement to product_listing.php to test the SQL statement that is generated by $listing_split. This is what I got:
SELECT DISTINCT p.products_model, p.products_image, pd.products_name, p.products_quantity, 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 = '1' and p2c.categories_id = '3' GROUP BY p.products_id HAVING ( FIND_IN_SET("FrameColorFamilygold", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))) order by p.products_sort_order, pd.products_name limit 150
When I put this into the SQL box in phpMyAdmin, I get this message "MySQL returned an empty result set (i.e. zero rows)."
I guess this means since the page thinks there are 4 products to show but the SQL doesn't show any that there is some kind of issue with the SQL. I don't know.
I have double checked to make sure that no files were missing from the upload of Dynamic Filter and that none of those files had been previously altered by other addons.
I will continue to plug on.
Re: Dynamic Filter 1.0 not working for Options
I am setting up a new site with Zen 1.5.1. From what I can tell, your modified core files are very much different from the ver 1.5.1 files. The differences are more than just what is inside your “// bof dynamic filter x of x” and “// eof dynamic filter x of x” comments. Can you provide some guidance here?
Re: Dynamic Filter - works on some categories, doesn't on others
I'm still trying to solve this issue and I'm not sure where to go from here.
I have checked the assigned attributes on the site as well as in the database through phpMyAdmin. All the products that have attributes assigned show the same in both places.
Oddly, now when I apply the same filter "Gold" to the wood molding category instead of saying "Displaying 1 of 3" like it did before or "Displaying 1 of 4" like it should, it says "Displaying 1 of 2" and still doesn't show anything on the product page.
I have checked the errors in my cache and still only get "PHP Warning: strlen() expects parameter 1 to be string, array given in /includes/functions/functions_general.php on line 153". Since the forum fix I mentioned earlier did not work (it was for an unedited version of functions_general.php and Dynamic Filter changes this file), but the forum did mention that this issue was solved in 1.5.1, I downloaded the functions_general.php file from 1.5.1 and added the Dynamic Filter code to it. I don't know if that was a good idea or not but since I'm trying anything I can think of, I gave it a shot. This did not solve the filtering problem and I'm still getting the PHP warning message in my cache. Other people were getting that error with checkout and I'm getting it from filtering (timestamp is the same as when I try to filter) so I really don't know what would be causing that.
I have reverted back to the functions_general.php file that came with Dynamic Filter for v1.5.0.
I am not well-versed in php or MySQL. I don't know what else to try but would like to use Dynamic Filter. Does anyone with more knowledge on these topics have an idea of what I should try next or maybe just already have a solution to this problem.
Thanks!
Re: Dynamic Filter - works on some categories, doesn't on others
also in 1.5...
I had a very similar issue (on the "displaying 1 of 3" etc) response, and found that it did that whenever I had products of that type in the database but set Status=0.. Apparently Dynamic Filter looks at all products, but doesn't filter by status when returning results. I did an updated to status=9 (deleted them), and this was solved... Do you have products loaded which are status=0?
On a similar yet slightly variant level, i'm continuing to get highly erratic results whenever Dynamic Filter is used on a category page..
Example: Filter by attribute type X for values 1, 2, 5, and it returns items with attribute values of 1,2,3,4,5,6 and 7.... Unknown reason.
It seems to work perfectly well AS LONG AS I'm using the filter in "all products" mode...
Is this a known issue?
Re: Dynamic Filter - works on some categories, doesn't on others
macnerd,
Thanks for the suggestion but all my products have a status of 1. Any other ideas?
Re: Dynamic Filter - works on some categories, doesn't on others
Still trying to solve this problem.
The only thing I know to go on is that we keep getting "PHP Warning: strlen() expects parameter 1 to be a string, array given in..." error. Unlike other posts that I have found on the forum, we do not get this error with shopping cart checkout, but instead when trying to filter in certain categories with Dynamic Filter.
As I mentioned earlier, I did try the fix suggested by DrByte but since that was for a clean functions_general.php file (not one changed by Dynamic Filter) and presumably would be to solve the checkout problem, not a filtering one, it did not solve our issue.
However, I have continued to look and try. I found another suggestion by DrByte to debug what may be causing the issue.
http://www.zen-cart.com/showthread.p...e-string/page2
This is what was noted in the myDEBUG file after applying the debug and attempting to filter in the category "wood molding":
[26-Nov-2012 17:03:30 UTC] PHP Notice: GET param found to be array: Array
(
[0] => Gold
)
--- contents of GET: Array
(
[main_page] => index
[cPath] => 1_3
[fltFrameColorFamily] => Array
(
[0] => Gold
)
)
in ***/includes/functions/functions_general.php on line 152
So, to me this says that the issue is definitely with filtering in this category as it returns an array when trying to filter by color family.
I tried the fix suggested by DrByte again. This time I was more careful about placement since I have the Dynamic Filter addon. It seems to have worked. I am no longer getting the PHP Warning. However, the filter still does not work.
Any ideas from someone with more experience?
Thanks!
Re: Dynamic Filter - works on some categories, doesn't on others
When I first discovered the Dynamic Filter I thought it potentially the greatest customer-side plugin of all time. Now I'm not so sure. We installed it on two of my sister's main sites and one site at least is having a problem with All Products. We recently turned off All Products on that site for now.
I also sometimes notice a server/site slow-down on a large category...or All Products...as the filter apparently takes awhile to "think."
Anyway, I'll see if the status mentioned in post 5 above may affect our All Products issue.
Framegirl, yes, your filter works in one category that I saw but not the other. Can you put some Read Only attributes on a couple of products in yet another category to see if it works? Just as a means of helping trouble-shoot.
I really don't know anything about coding, but I wouldn't feel comfortable trying to apply a fix for an unrelated plugin or issue. You might try pm'ing the developer to see if he will take a look at your thread here, as he may have an idea.
Steve
prommart.com
fashion-mart.biz
PS: Your site has some other customer usability issues which you might want to post on the site Reviews thread. And if you're not using your homepage ezslider you might want to disable the jscript for that so all it's code doesn't show in view source on homepage and category pages. I put a ~ at the end of the file to disable, if not deleting.
Re: Dynamic Filter - works on some categories, doesn't on others
SPH,
I already tried putting read only attributes on a few products in another category as a means of trouble shooting. It worked fine. The issue seems to only be in categories that have attributes with pricing attached, even though those attributes are not ones we have available for filtering.
Thanks for the suggestion of PMing the developer and disabling the ezslider. I will work on that today.
With the usability issues, do you mean the site is hard to maneuver or that there are major issues?
Thanks.