Dynamic Filter [Support Thread]
Hi there, I'm using dynamic filter mod by damian taylor - which is an awesome mod btw, you can see it at work on his website http://www.snowrepublic.co.uk/ (click on a category). It's a product filter for prices, manufacturer, attributes etc...
Anyway, the mod has been updated to work with 1.5 and I'm testing it on a brand new install with no other mods.
When I switch admin->configure->productlisting->display category/manufacturer filter off (which is the default zencart product filter and required to be turned off to make parts of damians mod to work) I get errors.
Here's one:
Quote:
[03-Mar-2012 13:36:42] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), 'Y', 'N') as flag FROM manufacturers WHERE manufacturers_id IN (0,) ORDER BY ' at line 1 :: SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(0,), 'Y', 'N') as flag FROM manufacturers WHERE manufacturers_id IN (0,) ORDER BY manufacturers_name in C:\xampp\htdocs\zencart\includes\classes\db\mysql\query_factory.php on line 101
Quote:
and another:
[02-Mar-2012 15:20:10] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY p.products_id' at line 1 :: select distinct p.products_id FROM products p LEFT JOIN manufacturers m USING(manufacturers_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 categories c on p2c.categories_id = c.categories_id LEFT JOIN meta_tags_products_description mtpd ON mtpd.products_id= p2c.products_id AND mtpd.language_id = 1 LEFT JOIN tax_rates tr ON p.products_tax_class_id = tr.tax_class_id LEFT JOIN zones_to_geo_zones gz ON tr.tax_zone_id = gz.geo_zone_id AND (gz.zone_country_id IS null OR gz.zone_country_id = 0 OR gz.zone_country_id = 222) AND (gz.zone_id IS null OR gz.zone_id = 0 OR gz.zone_id = 193) WHERE (p.products_status = 1 AND pd.language_id = 1 AND p2c.products_id = p.products_id AND p2c.products_id = pd.products_id AND (p2c.categories_id = 5)) AND p.products_date_added >= '20100101' and p.products_date_added <= '20120101' AND (p.products_price_sorter * IF(gz.geo_zone_id IS null, 1, 1 + (tr.tax_rate / 100)) >= 5) AND (p.products_price_sorter * IF(gz.geo_zone_id IS null, 1, 1 + (tr.tax_rate / 100)) <= 55) group by p.products_id, tr.tax_priority GROUP BY p.products_id in C:\xampp\htdocs\zencart\includes\classes\db\mysql\query_factory.php on line 101
So the problem is the SQL, but which is more correct - the mod's version (which presumably is uptodate coz it's been passed for 1.5) or my xampp version?
Also, I don't suppose if anyone knows if this is an easy fix? :)
thanks
Re: Dynamic Filter - getting sql errors
Really a great Mod. I installed in my 1.3.7.1 version and works perfect except with the prices ranges that show me the ranges without tax. For example if I select a price range between 100€ and 200€, the product list show me products until 236€, just 1,18% VAT.
Any ideas about how to the price range selector include the TAX?
Thank you.
Re: Dynamic Filter - getting sql errors
well even though you're kind of hijacking my thread which will probably mean that no-one will ever answer me :( I suppose no-one had answered yet so... ah well
the mod calculates the price ranges in the file includes/templates/your_template/sideboxes/tpl_dynamic_filter.php
around line 71 is where it creates the $priceArray[] which is the products_price_sorter field from the products table in the DB (exactly the same as product_price field - ie the price without tax) I guess you just need to alter that line so that the price which ends up in the array is including tax. Not sure if there's a zen way of doing this, there probably is :)
hth
ps don't suppose you know anything about SQL?
Re: Dynamic Filter - getting sql errors
In case it helps the sql gets made like this:
$categories = $db->Execute("SELECT categories_id, categories_name, IF(categories_id IN (" . implode(',', $filteredCategories) . "), 'Y', 'N') as flag" .
" FROM " . TABLE_CATEGORIES_DESCRIPTION .
" WHERE categories_id IN (" . implode(',', $unfilteredCategories) . ")" .
" ORDER BY categories_name");
$filteredCategories and $unfilteredCategories are just arrays with master_category_id's in them.
I'm currently reading through some sql text books but I haven't yet got my head around all these inner-queries and IN and IF and blaa blaa...
Re: Dynamic Filter - getting sql errors
How do you control which filters show up. I thought it had to do with the option values but not all of the option values appear, more specifically the filter for that attribute or option doesn't even appear on the page. I left the include option blank on the Dynamic filter configuration page.
Dynamic Filter 1.0 not working for Options
Hello,
I installed Damian Taylor's Dynamic Filter 1.0 and it seems to work fine expect I always get no results when filtering on my 1 defined option (4 choices, test products have 2 of 4 assigned).
I check and rechecked the options and they appear correct and hsow up on the prduct pages.
The Filter displays the correct options (the 2 of the 4 I assigned to products) but when I choose one or the other, no products are found.
Any thoughts?
Thanks!
David
Re: Dynamic Filter 1.0 not working for Options
Quote:
Originally Posted by
Daviator
Hello,
I installed Damian Taylor's Dynamic Filter 1.0 and it seems to work fine expect I always get no results when filtering on my 1 defined option (4 choices, test products have 2 of 4 assigned).
I check and rechecked the options and they appear correct and hsow up on the prduct pages.
The Filter displays the correct options (the 2 of the 4 I assigned to products) but when I choose one or the other, no products are found.
Any thoughts?
Thanks!
David
If the option name is made of 2 or more words (with space between), the results are: "There are no products to list in this category".
If I delete the space between the words in the option name, it filters correctly.
I've tried this in the Demo on clean 1.38a install.
Author confirmed this as a bug.
Does anyone know how to fix it?
Re: Dynamic Filter 1.0 not working for Options
Maybe a bug, but no space is how we MUST do it to do a vlookup with our attributes in excel in Easy Populate: our Colors if two or more words.
Example "Hot.Pink" here:
http://www.prommart.com/index.php?ma...oducts_id=6832
The color drop down shows "Hot.Pink", with the period between the words. Necessary when incorporating our colors in our DB in the Easy Populate excel vlookup function.
BTW, I just got the Dynamic Filter working on a fresh 1.5.0 install on demo site:
http://www.prom-mart.com/demo-1/big-linked-c-22.html
Dynamic Filter - Left Col Boxes Misaligned
Just installed Dynamic Filter (what we've been looking for) on 1.5.0 Demo/Test:
http://www.prom-mart.com/demo-1/big-linked-c-22.html
So excited it seems to work that I only just now noticed that it misalignes the regular category and other boxes, noticeable because of the border.
Not a deal breaker with this mod, but anyone know of a fix?
Thanks.
sph
www.prom-mart.com
Zencart Testing
Re: Dynamic Filter - Left Col Boxes Misaligned
I think it is because of a bug in the 'scroll' method that misses div end tags.
If you put it in to 'expand' mode it should render correctly.
I'll be uploading a fix in the next few days