works now
can i show dynamic filter on home page (index page)?
Printable View
works now
can i show dynamic filter on home page (index page)?
Glad you got it working, and see this post
i'd like to use dynamic filter with seo url mod, but i got an issue
turn off seo url mod, the url is .../index.php?main_page=index&cPath=9&fltBrand%5B%5D=3
turn it on, the url becomes .../category-name/fltBrand/Array
what do i make that "Array" to "manufacturer id"?
and the ideal url would be .../category-name/fltBrand_manufacturer-name-3
is there an example site which is used seo url mod, filter style Checkbox Single and options box expand ?
I have this module installed however I can't get it to filter multiple attributes at the same time. For example my site sells dresses. If a customer wants to look for a white color dress, size 4, within a price range of $199 -- $224 in the same search I want them to be able to narrow their choices by filtering for all 3 attributes, color, size and price at the same time using checkboxes to select criteria. The only way I have been able to get the module to work is one attribute at a time, i.e. filter by price, or filter by size or filter by color.
Please help.
Dennis
if you are using seo url module for your site, after installing Dynamic Filter,
set Filter Style to Link, it works, the url is correct, domain.com/product-1?fltBrand[]=2
set Filter Style to Checkbox (Single), the filter doesn't work, and the url is not correct, domain.com/product-1?fltBrand=Array
what do i use Dynamic Filter together with Seo Url mod?
Im having some problems with the alignment of the sidebox (dynamic filter)
I put it in sidebox left but it adds a random enter so my right box appears under the dynamic filter sidebox
Example of my problem
anybody know how to fix this ?
Attachment 13778
Managed to fix it;
i had the left column disabled in the settings (enabled it) and then disabled it for the categories where i didnt need that by using this code:
edit the cpath values with the values of cats where u want to disable the columnCode:if ($this_is_home_page == true) {
$flag_disable_left = true;
$flag_disable_right = true;
}
if (in_array($cPath,explode(",",'670,671,660,657,658,661,653,652')) ) {
$flag_disable_left = true;
}
put in :
/httpdocs/shop/includes/templates/your_template/common/tpl_main_page.php
and its fixed :)
hi! Got little bit of problem on my hand right now. After I installed this module all I got is white blank page. I know it is not supossed to be like this. Any idea what went wrong? I got ImageHanlder installed and thats only this module also I use newest responsive Sheffield Blue template and newest Zencart
try to enable error reporting:
http://www.zen-cart.com/content.php?124
this might show you the error which is happening in the background
it sounds to me like you overwritten some of your theme files which broke the addon, try to merge the files from
template file overrides
with your files in your theme
it could allso be you have not uploaded the files in the right spot or missed some of the files, doublecheck that!
Hi
I have the same problem and it has nothing to do with the theme. The error logs clearly indicate that there something wrong with the functions_general.php of the module. I have tried it on a clean installation and it keeps breaking. I can replace the functions_general.php file with the zen 1.51 original and the web site comes back again.
20-Feb-2014 11:14:26 UTC] PHP Fatal error: Cannot redeclare zen_create_random_value() (previously declared in xxxxxxxxxx\includes\functions\functions_general.php:626) in xxxxxxxxxx\includes\functions\password_funcs.php on line 86
The same error has been acknowledged as a conflict between an old version and a new version of the file by DrByte. http://www.zen-cart.com/showthread.p...om_value%28%29
If someone could check that out will be greatly appreciated.
Thanks
Tassos
Hi
Just checked the module with zen 1.5 and the standard as well as the same theme as before and it works fine so it is definitely not compatible with zen 1.51.
Thanks
Tassos
Just an update and my apologies as the solution is already there. I think the developer(s) should modify the module to include DrBytes solution or at least included it in the documentation as a troubleshooting note.
Anyway for anyone looking for the solution it can be found here: http://www.zen-cart.com/showthread.p...-Thread/page22 Just look half way through for DrBytes revision. It works perfectly and I tested with a couple of different themes with no problem.
Hope it helps
tassos
Hi
I can not find any answer to my issue below through the forum so I hope that someone can help because I have found what I think is a bug.
I will try to explain and hopefully it makes sense. Overall I can click on All Products/New Products etc and it seems that it works fine. I can click on a first level category with products and it works fine again. The problem is that if I click/select on a second level category that it has no independent attributes set then the sidebox breaks and everything goes crazy with all boxes below the module going down the bottom of the page.
This happens because if there are no attributes assigned to a product the filter only displays as search options the Brands and Price. I can add an attribute and then everything is fine again. Effectively that means that you have to have at least one attribute that will apply to all products otherwise the module does not work as it breaks the layout. I have tested with different templates and there is always the same result. The only template template that does not do that is the default "classic" one.
I know that if it works in the classic then it is a template issue but why it works on all templates tried once there is an attribute assigned to the products and not when there is not and there is only Brand and Price.
I have tried to compare files/directories without success. It just seems to me that there is some if/then/else function missing to cover for such an event of no additional attributes but would not know where to start/finish.
Any ideas will be greatly appreciated and sorry no online access as working on xampp at the moment.
Regards
Tassos
if you are using both Dynamic Filter and seo url mod,
set Filter Style to Checkbox (Single), the filter doesn't work, and the page goes to domain.com/product-1?fltBrand=Array
i think it's a bug, cause i tried installing a fresh store, only with 2 mods: dynamic filter and seo url, and i also tried different seo url mods,
always get the same error
anyway, if i set Filter Style to Link, it works
what do i use Dynamic Filter checkbox filter style together with Seo Url mod ?
Im having some problems with this mod,
For some of my attributes this is working perfect but when adding more then 4 attributes to a product it fails to give me any results (when filtering)
Attachment 13864
Here it shows the product attributes for this product!
After filtering, it does not show me the results allthough this product does have this attribute
Attachment 13865
This is the url that is being generated by the script:
Attachment 13866
I have not been able to find where the problem occurs, anybody have a pointer which can help me get this script functional ?
thanks a lot in advance
Ive looked in /cache/ logs files but it does not show me any errors, ive allso enabled strict error reporting, does not work too (no error message)
Managed to fix my problems (PHP Warning: trim() expects parameter 1 to be string, array given in);
Updated my zencart to 1.5.1, edited functions_general with the fixed dr_blyte supplied.
Now everything is working okay !
If you dont have experience with editing core files stay away from this 1.5.1 update since it requires modding of the core files...
Anybody know if it is possible to change the sort order of the items in the sidebox ?
i have tried playing around with the sort order in the zencart admin but it does not give any results !
Attachment 13902
Im also looking for a method to collapse the panels withing the sidebox, anybody got something working for this ?
I would like to be able to click the option name (the filter name) and then collapse the available filter options !
maybe somebody can point me in the right direction
this will explain the problem i have a little better
when i change the sort order around (like change number 2 to 98) it still shows in the first position
here some screenshots to explain better
Attachment 13904
Attachment 13905
changing the sort order around does not result in another order :P
who can point me in the right direction ?
Managed to fix the sort order;
open includes/templates/YOUR_TEMPLATE/sideboxes/tpl_dynamic_filter.php
FIND:
REPLACE WITH:"Code:if(count($filteredProducts) > 0){
// Below line counts up all quantities of each item. e.g. if a glove is available in Small and Medium, quantity = 2.
//$attributes = $db->Execute("SELECT po.products_options_name, pov.products_options_values_name, count( p2as.quantity ) as quantity" .
$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");
Now the filters are sorted by products_options_sort_order (the order u set in the admin when adding the new attributes) instead of alphabeticallyCode:if(count($filteredProducts) > 0){
// Below line counts up all quantities of each item. e.g. if a glove is available in Small and Medium, quantity = 2.
//$attributes = $db->Execute("SELECT po.products_options_name, pov.products_options_values_name, count( p2as.quantity ) as quantity" .
$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_sort_order");
No support for this plugin, dont use in live shop with lots of products since it will screw up
Hello everyone, I use the attributes (read only).
I'm trying to run this plugin with zencart 1.5.1 but there is no way that it works.
I would be interested to simply filter the products based on the attributes (read only), without the filter of the price or other features of attributes (prices vary, types of product in the cart, or similar functions). I do not need.
I do not care a sidebox that creates the filter attributes.
I wish that in the product listing where I put the sort order by price, add a filter for attributes. And nothing else :)
Thanks in advance to those who answer :)
Hi all,
I've spent far to many hours pulling my hair out, and need to admit defeat and ask for help. It probably an easy fix for someone who knows what they're doing, there's a lot of similar issues posted before me, but implementing fixes suggested before hasn't helped.
The filter works perfectly in some categories (https://ainleyorganics.co.uk/breakfast-products-c-848/), but breaks the page in others (https://ainleyorganics.co.uk/breads-c-798/).
My functions_general.php file is as follows:
My log file is as follows:Code:function zen_get_all_get_params($exclude_array = '', $search_engine_safe = true) {
if (!is_array($exclude_array)) $exclude_array = array();
$exclude_array = array_merge($exclude_array, array(zen_session_name(), 'main_page', 'error', 'x', 'y'));
$get_url = '';
if (is_array($_GET) && (sizeof($_GET) > 0)) {
reset($_GET);
while (list($key, $value) = each($_GET)) {
// bof dynamic filter 1 of 3
if ( (!in_array($key, $exclude_array)) && (strlen($value) > 0 || is_array($value) && array_filter($value) ) && ($key != 'main_page') && ($key != zen_session_name()) && ($key != 'error') && ($key != 'x') && ($key != 'y') ) {
// eof dynamic filter 1 of 3
if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
// die ('here');
$get_url .= $key . '/' . rawurlencode(stripslashes($value)) . '/';
} else {
// bof dynamic filter 2 of 3
if (is_array($value)) {
foreach($value as $arr){
$get_url .= zen_sanitize_string($key) . '[]=' . rawurlencode(stripslashes($arr)) . '&';
}
} else {
// eof dynamic filter 2 of 3
$get_url .= zen_sanitize_string($key) . '=' . rawurlencode(stripslashes($value)) . '&';
// bof dynamic filter 3 of 3
}
// eof dynamic filter 3 of 3
}
}
}
}
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);
return $get_url;
}
I'd really appreciate some help on this. Thanks in advance.Code:PHP Warning: strlen() expects parameter 1 to be string, array given in /home/....../public_html/includes/functions/functions_general.php on line 152
It does not help when you post links and then decide to disable the mod in question. There is no way to troubleshoot the issue. If you want help and need to run a live site at the same time, make a testing site and do all changes there. FYI, this mod does work with v1.5 and v1.51. The only tricky part is doing merges to a few core files as alot has changed since this mod came out.
Thanks for your response, I left it active for 24 hours but as it screwed up various parts of the site (footer disappeared, menu moved etc), and I got an email from a customer complaining she had issues, I decided to deactivate it, and give up. Instead I added a suffix to the titles, so the attributes could be easily identified without entering the details for each product individually. It is something I'd love to fix though.
As a short term measure, I have activated it on a similar site (virtually a copy of the site I previously linked to, where I have exactly the same issues).
You will see on this page that the menu has moved to the very top of the page, and sideboxes seem to have moved to the centre: http://healthandwholefoods.co.uk/m-c...e-c-2689_3128/
The symptoms are virtually the same, so I'm certain if I fix one, I'll be able to fix the other.
Thanks
Martin
I just installed this mod, it seems to be exactly what I need, however none of my read-only attributes show. I have to have read-only attributes for the Google Merchant Feeder mod and would like some of these [pattern, color, etc] to be searchable with Dynamic Filter. I do have SBA installed and don't apply stock levels to read-only attributes.
Is there a way to show attributes that are read-only with Dynamic Filter?
do anyone know if there is a way to add an "in stock" filter option?
The simplest method is to create a read only attribute as in-stock and out-of-stock and then hide that attribute with css. But this may not be feasible if you have a large number of products or products that change frequently. If you wanted a method that is automatic based on when product quantity goes to "0" then this would take a modification approach to the core code of dynamic filter.
The approach is up to you and depends on your expertise to do the latter approach. The way dynamic filter is coded, it shouldn't be too difficult to get it to work.
Thanks for your reply.
The hidden attribute solution will not be good enough as I have products going in and out of stock. It'd be too much maintenance.
I have some php-skills and good sql-skills, but I guess I need some guidence to where to start.
Or maybe I could make a db-trigger to update the attribute when stock is <=0 thoughts?
I have not touched the core code of this mod in a while so I would have to relook at what routes can be done. But I would say that would be a good place to start. This is a bit of code from the core that I used to do a custom dropdown for a friend which basically disables the products from the dropdown when stock reaches a predetermined level he targets.
So you could use this logic in your code to trigger the change of the attribute. Bascially just make sure to loop through the products and then the function will assign "instock" and "outofstock" automatically.Code:function zen_get_product_quantity_form($product_id) {
global $db;
$sql = "select products_quantity from " . TABLE_PRODUCTS . (zen_not_null($product_id) ? " where products_id=" . (int)$product_id : "");
$check_quantity = $db->Execute($sql);
return $check_quantity->fields['products_quantity'];
}
But another approach is to just go in the tpl file for dynamic filter and basically make a custom filter selection to loop through all products and either give the 2 choices of "instock" and outofstock" based on the function above results on the quantity. This would be the easier way as you won't have to touch the core code of messing with the attributes but instead just have the filter give selections based on the quantity value. This would be the way I would approach it.
Thank you again. I took a look at the file for the dynamic filter, but i figured I probably would use several hours getting this working.
Instead I made a database trigger on the products table. Every time the table is updated the trigger updates my newly created stock attribute to in stock/out of stock according to products_quantity. Not too pretty, but effective :)
Ok, so I turned on the sidebox, and it seems to act kind of strangely.
In all categories/subcategories but one it works like a charm, but in one subcategory when I filter on an attribute the result is empty, but the text underneath where the products should have been show: "Showing 9 of 9 products"
9 products is the correct amount, but none of the 9 is shown.
I cant show you on my site as I have disabled it to not confuse my customers.
Anyone heard of this kind of behaviour?
I found out that it happens to all products with more than 4 attributes.
Is it a limit to how many attributes the dynamic filter can handle to loop through?
The attribute in question is a read only attribute. Everything is working fine exept filtering on attributes when there are more than 4 on the product
After more digging, I've found out that its not 4 attributes thats my upper limit, its more randomly than that.
Adding/removing attribute values from a product change if the filter for that particular filter works or not.
An example. A product has 6 attributes with in total 15 attribute values. The filter on attribute "stock" does not work.
I remove one attribute value from one of the other attributes, for instance a color.
Now the filter on attribute "stock" works just fine.
It doesnt matter what attribute value I remove, so its not just one attribute or value which causes this... hmmmmmmm.....
suggestions?
another "fun feature", if I delete the language english, only keeping norwegian, it works as it should.
Im having exaclty the same problems, very hard to replicate the problem but it appears to only not filter for products with a lot of attributes, i havent tried to delete the english language. but i will give that a try to see if it fixes stuff
Really need a fix for this plugin
I have tried removing the english language, but that still doesnt fix the problems with filtering.
As the person above me i have the error:
Code:[05-Jun-2014 12:15:58 Europe/Amsterdam] PHP Warning: trim() expects parameter 1 to be string, array given in /var/www/vhosts/domain/httpdocs/shop/includes/functions/functions_general.php on line 63
[05-Jun-2014 12:15:58 Europe/Amsterdam] PHP Warning: trim() expects parameter 1 to be string, array given in /var/www/vhosts/domain/httpdocs/shop/includes/functions/functions_general.php on line 63
Here you can see how buggy it is:
http://www.etcoevorden.nl/shop/index...ex&cPath=23_42
This shows a lot of products, but when clicking on the "Discovery 1 1990-1998" Filter on the left side
It doesnt show me any results (in the bottom it shows -> Artikel 1 tot 10 (van 18 artikelen) (so it should have at least 1 result)
If you check one of the products in this category -> http://www.etcoevorden.nl/shop/index...&products_id=8
It does show Attribute -> "Discovery 1 1990-1998" in the bottom so it should be able to find it ?
Im currently running Zencart 1.5.1 and i have tried to add the fixes posted by dr blyte
This is on line 63 in functions_general:
My PHP version is 5.3.23Code:function zen_parse_input_field_data($data, $parse) {
return strtr(trim($data), $parse);
}
Zencart 1.5.1
I found the language code I have added to the filter to show multiple languages.
in includes\templates\YOUR_TEMPLATE\sideboxes\tpl_dynamic_filter.php find
and replace withCode:$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");
Code:$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) . ")" .
" AND language_id=" . (int)$_SESSION['languages_id'] .
" ORDER BY categories_name");
Did anyone figure out how to use this with SBA and not have the filter ignore products with no stock?
Sorry, I meant not having the filter ignore products without a SBA stock value. It does work if every product with attribute has a SBA stock value, even zero if you alter the sql statement slightly. But this seems highly wasteful as it adds quite a few attributes.
Seems I must have made some mistake when I installed this module. I did a complete reinstall, altered the sql to >= 0 and voila! It works.
Im just going to be quiet now. :blush: When using SBA, every product with attribute must have a SBA stock id. So my question remain.
any chance you can help me and panservolvo to fix our problems with the filter not working for products with a lot of attributes?
I know that this is a tad late :blush:, but here's the correction that I made to remove the referenced PHP Warning:
Note also that the installation SQL script, out-of-the-box, (a) wipes out the configuration_group_id of 0 and (b) performs "blind" SQL inserts into the configuration table (causing issues if you've installed a plugin that adds a field to that table). Here's the updated version:Code:function zen_get_all_get_params($exclude_array = '', $search_engine_safe = true) {
if (!is_array($exclude_array)) $exclude_array = array();
$exclude_array = array_merge($exclude_array, array(zen_session_name(), 'main_page', 'error', 'x', 'y'));
$get_url = '';
if (is_array($_GET) && (sizeof($_GET) > 0)) {
reset($_GET);
while (list($key, $value) = each($_GET)) {
// bof dynamic filter 1 of 3
//-bof-20140806-lat9-Make sure the value's a string before using strlen
if ( (!in_array($key, $exclude_array)) && ( (is_string ($value) && strlen($value) > 0) || is_array($value) && array_filter($value) ) && ($key != 'main_page') && ($key != zen_session_name()) && ($key != 'error') && ($key != 'x') && ($key != 'y') ) {
//-eof-20140806-lat9
// eof dynamic filter 1 of 3
if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
// die ('here');
$get_url .= $key . '/' . rawurlencode(stripslashes($value)) . '/';
} else {
// bof dynamic filter 2 of 3
if (is_array($value)) {
foreach($value as $arr){
$get_url .= zen_sanitize_string($key) . '[]=' . rawurlencode(stripslashes($arr)) . '&';
}
} else {
// eof dynamic filter 2 of 3
$get_url .= zen_sanitize_string($key) . '=' . rawurlencode(stripslashes($value)) . '&';
// bof dynamic filter 3 of 3
}
// eof dynamic filter 3 of 3
}
}
}
}
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);
return $get_url;
}
Code:SELECT @cid:=configuration_group_id FROM configuration_group WHERE configuration_group_title= 'Dynamic Filter';
DELETE FROM configuration WHERE configuration_group_id = @cid AND @cid != 0;
DELETE FROM configuration_group WHERE configuration_group_id = @cid AND @cid != 0;
INSERT INTO configuration_group VALUES (NULL, 'Dynamic Filter', 'Dynamic Filter Settings', '1', '1');
SET @cid=last_insert_id();
UPDATE configuration_group SET sort_order = @cid WHERE configuration_group_id = @cid;
INSERT INTO configuration ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function)
VALUES ('Enable on Category Pages', 'FILTER_CATEGORY', 'Yes', 'Enable the filter on category pages?', @cid, '10', now(), now(), NULL, "zen_cfg_select_option(array('Yes', 'No'),"),
('Enable on All Products Page', 'FILTER_ALL', 'Yes', 'Enable the filter on all products page?', @cid, '20', now(), now(), NULL, "zen_cfg_select_option(array('Yes', 'No'),"),
('Enable on New Products Page', 'FILTER_NEW', 'Yes', 'Enable the filter on new products page?', @cid, '30', now(), now(), NULL, "zen_cfg_select_option(array('Yes', 'No'),"),
('Enable on Featured Products Page', 'FILTER_FEATURED', 'Yes', 'Enable the filter on featured products page?', @cid, '40', now(), now(), NULL, "zen_cfg_select_option(array('Yes', 'No'),"),
('Enable on Specials Page', 'FILTER_SPECIALS', 'Yes', 'Enable the filter on specials page?', @cid, '50', now(), now(), NULL, "zen_cfg_select_option(array('Yes', 'No'),"),
('Enable on Search Page', 'FILTER_SEARCH', 'Yes', 'Enable the filter on advanced search page?', @cid, '60', now(), now(), NULL, "zen_cfg_select_option(array('Yes', 'No'),"),
('Filter Style', 'FILTER_STYLE', 'Link', 'How are the filters to be applied?<br /><br /><strong>Link</strong> - Each option is a link; Only one filter can be applied at a time.<br /><strong>Dropdown (Single)</strong> - Each option is part of a drop down list; Only one filter can be applied at a time.<br /><strong>Dropdown (Multi)</strong> - Each option is part of a drop down list; Multiple filters can be applied at a time.<br /><strong>Checkbox (Single)</strong> - Each option is a checkbox; Only one filter can be applied at a time.<br /><strong>Checkbox (Multi)</strong> - Each option is a checkbox; Multiple filters can be applied at a time.', @cid, '70', now(), now(), NULL, "zen_cfg_select_option(array('Link', 'Dropdown - Single', 'Dropdown - Multi', 'Checkbox - Single', 'Checkbox - Multi'),"),
('Disabled Options Method', 'FILTER_METHOD', 'Greyed', 'How are the unavailable filter options to be disabled?<br /><br /><strong>Greyed</strong> - Grey out the unavailable options.<br /><strong>Hidden</strong> - Hide the unavailable options.', @cid, '80', now(), now(), NULL, "zen_cfg_select_option(array('Greyed', 'Hidden'),"),
('Options Box Style', 'FILTER_OPTIONS_STYLE', 'Scroll', 'Which style of box should be used when the maximum number of options has been reached?<br /><br /><strong>Scroll</strong> - Scroll box.<br /><strong>Expand</strong> - Expanding box with More/Less link.<br /><br /><strong>Note: This option is only applicatble with Link or Checkbox filter styles.</strong>', @cid, '90', now(), now(), NULL, "zen_cfg_select_option(array('Scroll', 'Expand'),"),
('Maximum Number of Options', 'FILTER_MAX_OPTIONS', '9', 'What is the maximum number of options to be displayed before scroll bar/More link is visible?<br /><br /><strong>Note: This option is only applicatble with Link or Checkbox filter styles.</strong>', @cid, '100', now(), now(), NULL, NULL),
('Maximum Number of Price Ranges', 'FILTER_MAX_RANGES', '5', 'What is the maximum number of price range groups?<br /><br /><strong>Note: This can be overridden by the Maximum Price Range parameter</strong>', @cid, '110', now(), now(), NULL, NULL),
('Minimum Price Range', 'FILTER_MIN_PRICE', '10', 'What is the minimum gap in the price ranges?<br />Set as zero to deactivate.', @cid, '120', now(), now(), NULL, NULL),
('Maximum Price Range', 'FILTER_MAX_PRICE', '25', 'What is the minimum gap in the price ranges?<br />Set as zero to deactivate.', @cid, '130', now(), now(), NULL, NULL),
('Include Options', 'FILTER_OPTIONS_INCLUDE', '', 'Enter the list of option IDs to be included in the filter, separated by commas (i.e. 1,2,3)<br />Only the option numbers listed here will appear in the filter.<br />Leave blank to deactivate.', @cid, '140', now(), now(), NULL, NULL),
('Exclude Options', 'FILTER_OPTIONS_EXCLUDE', '', 'Enter the list of option IDs to be excluded from the filter, separated by commas (i.e. 1,2,3)<br />The option numbers listed here will <strong>not</strong> appear in the filter.<br />Leave blank to deactivate.', @cid, '150', now(), now(), NULL, NULL),
('Google Event Tracking', 'FILTER_GOOGLE_TRACKING', 'No', 'Use Google Event Tracking?<br /><br /><strong>No</strong> - Do not use Google Event Tracking<br /><strong>ga.js</strong> - Use traditional ga.js Google Event Tracking method<br /><strong>Asynchronous</strong> - Use new asynchronous Google Event Tracking method<br /><br /><strong>Note: Requires Google Analytics Code</strong>', @cid, '160', now(), now(), NULL, "zen_cfg_select_option(array('No', 'ga.js', 'Asynchronous'),");
/*
zencart 1.5 mods
*/
DELETE FROM admin_pages WHERE page_key='configDynamicFilter';
INSERT INTO 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);
Hi,
I installed the Dynamic Filter version 1.5.0 on my test zen cart version 1.5.1, according to the instructions, including the SQL install. I did not have any errors or conflicts on the files. After configuring the plugin in the Admin backend, the front-end display JUST a blank page with a 500 error. The front-end worked properly before I backed up the files/database and installed the plugin.
Anyone have any ideas on what the problem is or how I can troubleshoot it? Although I have programmed php and mysql for years, I am stuck right now.
Here is some more info:
PHP Version: 5.4.29 (Zend: 2.4.0) PHP Memory Limit: 256M
Database: MySQL 5.5.37-35.1
Thanks
Thanks, but I did check the logs before I posted - to no avail. I did go through and re-install the plugin late last night - with partial success. My website front-end is now visible to me (not published for the world yet), but I do not see the sidebox, even though I enabled it by following the configuration instructions several times.
I checked the logs again - nothings. And there is nothing in the Firefox HTML console either, except for the sideboxes I already have that display properly - and no errors in the general console.
I re-installed a vanilla zen cart and added dynamic filter back in. The admin section is okay and the front-end is displaying, but NO DYNAMIC FILTER!!!
And no log information!
Configuration Info:
Zen Cart 1.5.1
PHP Version: 5.4.29 (Zend: 2.4.0) PHP Memory Limit: 256M
Database: MySQL 5.5.37-35.1
Anyone have suggestions for fixes or the best debugging tool? Please help!
Are you sure you uploaded all the files correctly especially the files in the sidebox folder? What language is your webshop in ?
I did the install from scratch again and followed the instructions precisely again. I still had the white screen. After googling for the solution again and reading the suggestions, including the Dr Bytes fix (did not work), I copied the original functions_general.php file back to my server and now it works.
Now I need to figure out how to get it to display on the main or home page. Any ideas or pointers to other posts?
from what i remember its not possible to add this on the main/frontpage
Love This Mod but when I updated to the latest version of Zen Cart the Dynamic Filter Crash my site leaving it with a white screen. Is anyone else having this problem?? I reverted back to my back up before I installed the dynamic filter and the site worked again. I tried 3 more times with the same result. Anyone else having the same problem?
This plugin is allso not updated for 1.5.1 and needs a lot of custom edits to get it working on 1.5.1
As far as I remember, the only files that I had make changes to make it work with 1.51 was for split_pages_php and functions_general.php. Those were the ones that needed more careful attention as those core files has changed some since the last update mod. As far as the other files, it wasn't neccesary but I ended up merging them just so the files are updated with the appropriate headers. But so far, this mod has installed smoothly.
And for those who use the links method, you may want to add better categories and apply it to this mod. It makes for a much better visual for the customer.
Confirm, the module does not work with the latest Zen Cart 1.5.3. The error log says the following:
PHP Fatal error: Cannot redeclare zen_create_random_value() (previously declared in W:\home\localhost\www\zen-cart-v153\includes\functions\functions_general.php:626) in W:\home\localhost\www\zen-cart-v153\includes\functions\password_funcs.php on line 75
So, blank page is under the store-front.
The mod does work with 1.5.3. But as you noted you cannot just blindly move all mod files to your store. Instead you have to compare the files and merge the codes accordingly. Functions general was 1 of the few files in this mod that has old code from previous versions. But the mod is documented well so merging is not an issue.
Hi,
any one to help me
The dynamic filter works as far as the listing page.
Once one of the filtered product is selected and the main product info is displayed, the filter fails to act on previous next navigation. the navigation goes back to the main category that the product belongs to
Thanks to all in advance
Hi all,
Will there be an update for 1.5.3?
Also Is there a mod to make the attributes page easier? (I want to add attributes with 1 click like in prestashop.) If not can someone make such a mod and how much does it cost?
Can someone redesign the dinamic filter so it looks like on opticsplanet (with sliders).
Thanks for the answers in advance!
Much appreciated Design75, :clap:
I'm looking forward to installing your updated version on 1.5.3!
Side question: How would one go about creating filters based on a sets of keywords (custom filters). Maybe include the meta tag data in the generation of the filters? or is this already part of this mod?
Thanks :D
Your welcome :blush:, I have no idea about custom filters. Never considered it.
This module is for me also still a hard one to understand how it is exactly working.
The new release will at least contain the next changes:
- backwards compatibility with versions < zc 1.5.3 will be dropped.
- complete module will be multi lingual
- did some code cleaning and moving from template files to module files
- added an optional product count behind every option
I am trying to fix a tax problem, because now price-ranges are only shown/calculated without tax
Very nice. I'll be happy to test your combined updates on the 1.5.3 site I'm developing. Once you make the updates available, I'll try my hand at adding data from the meta tags product description table or maybe custom product fields as part of the filter options.
I have a few sites that could really use this functionality since the products don't have attributes, but could still benefit from filters.
This may help (changes in blue) :
// File /modules/custom/dynamic_filter.php
------------------------------------------------------------
/ Price Range/Attribute filter
$manufacturerGroup = str_replace(' ', '', DYNAMIC_FILTER_MANUFACTURER_GROUP);
$categoryGroup = str_replace(' ', '', DYNAMIC_FILTER_CATEGORY_GROUP);
$priceGroup = str_replace(' ', '', DYNAMIC_FILTER_PRICE_GROUP);
$prvKey = '';
$prvHaving = '';
$filter = '';
$having = '';
$filter_attr = false;
reset($_GET);
while(list($key, $value) = each ($_GET)) {
// if(!is_array($value)) { // skip if not array // RodG
if(substr($key,0,strlen(DYNAMIC_FILTER_PREFIX)) == DYNAMIC_FILTER_PREFIX && array_filter($value)) {
$key = str_replace(DYNAMIC_FILTER_PREFIX, '', $key);
foreach ($value as $value) {
if($key == $manufacturerGroup || $key == $categoryGroup || $key == $priceGroup) {
if($key != $prvKey) {
if($prvKey != '') {
$filter .= ') and (';
} else {
$filter .= ' and (';
}
} else {
$filter .= ' or ';
}
}
// manufacturer
if($key == $manufacturerGroup) {
$filter .= "m.manufacturers_id = '" . (int)$value . "'";
$prvKey = $key;
// category
} else if($key == $categoryGroup) {
$filter .= "p2c.categories_id = '" . (int)$value . "'";
$prvKey = $key;
// price range
} else if($key == $priceGroup) {
list($low,$high) = explode("--",$value);
// Updated to include GST by RodG
$filter .= 'p.products_price_sorter>=' . ($low - ($low / 11)) . ' and ' . 'p.products_price_sorter<=' . ($high - ($high / 11));
// $filter .= 'p.products_price_sorter>=' . $low . ' and ' . 'p.products_price_sorter<=' . $high; // original code //
$prvKey = $key;
// attributes
} else {
if($key != $prvHaving) {
if($prvHaving != '') {
$having .= ') and (';
} else {
$having .= 'HAVING (';
}
} else {
$having .= ' or ';
}
$having .= ' FIND_IN_SET("' . $key . $value . '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))';
$filter_attr = true;
$prvHaving = $key;
}
}
}
//}
}
if($filter != '') $filter .= ')';
if($having != '') $having .= ')';
if($filter_attr == true && defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK')) $filter .= ' AND p2as.quantity > 0 AND FIND_IN_SET(p2a.products_attributes_id, p2as.stock_attributes)';
--------------------------------------------------------------------------------------------------------
OK, so it isn't going to be *exactly* what you want. This was a quick n dirty fix I added to a customers site to account for a 10% GST.
It shouldn't be hard to replace these hard coded calculations with variables obtained from the Tax tables though.
Cheers
RodG
Hey guys,
Thanks for the answers!
Would it be possible to set the filter so it searches in subcategories too? For example I have binoculars on my site. Category is binoculars and the subcategories are the brands (Zeiss Leupold etc). So if a customer sets a price range filter in the binoculars category, I want him to get the result of all brands in that price range.
Thanks for the answers in advance!
please dont push a update without fixing the big problems surrounding this plugin when working with large amounts of attributes...
search through the topic there are a lot of people with this problem!
I don't think there is a lot that can be done about that. In my opinion, and knowledge, this has to do with the server resources that are available for your site. Large amounts of attribute require large amounts of memory and cpu. But if someone knows a solution for that please help out.
Hi,
I'm not sure if this is a problem with dynamic filter or not as it was previously working but I have exhausted every possibility I can think of other than contacting my hosting company to see if they have changed anything. On my website www.eliterugs.com.au I have had dynamic filter installed for about a month, I had previously tested it and everything was bullet proof. Yesterday I noticed that the sort by price option returns a 403 forbidden error. All the other options work fine in any combination but as soon as you add the price it fails.
I was wondering if anyone had any idea what could be causing this. As far as I can remember all I have worked on in the last couple of days was adding some dynamic remarketing and analytics code and I upgraded my google merchant centre code.
There are no error logs generated by zen cart or my website and I have double checked my database against a backup from a month ago and it still looks the same.
I am open to any any and all suggestions at this stage as I have run out of ideas.
Thanks.
Thanks for the reply, after an extremely long day yesterday looking through all the code and undoing everything that I had worked on over the last 3 days trying to find the problem. I got onto my web host this morning and it turns out they had done a security update and turned on a new mod_security setting (341245) that was blocking this feature. They have now turned it off for me and everything is working perfectly once again. Hopefully this may help someone in the future if they experience a similar issue. The code it's self is still as bullet proof as ever. Thanks.
Some of my Option Values contain html code. This code is recognised and displayed correctly on the Product Info page but is not displayed correctly in the Dynamic sidebox - the complete code is shown instead of the formatted text.
I'm having difficulty in identifying the lines of Dynamic Filter code that control this - any suggestions?
Yes, of course - didn't mention it as I thought wouldn't be of much interest
In tpl_dynamic_filter.php
change
toPHP Code:
case 'Checkbox':
$filters .= '<li class="dFilterLink">' . zen_draw_checkbox_field($group . '[]', $attributes->fields['products_options_values_name'], (isset($_GET[$group]) && in_array($attributes->fields['products_options_values_name'],$_GET[$group]) ? true : false), ($linkClass == 'disabled' ? 'disabled="disabled"' : '') . ($onClick != '' && FILTER_STYLE == 'Checkbox - Single' ? ' onclick="' . $onClick . '"' : '')) . htmlspecialchars(html_entity_decode($attributes->fields['products_options_values_name'], ENT_QUOTES)) .' <span class="no_of_attributes">(' . htmlspecialchars(html_entity_decode($attributes->fields['quantity'], ENT_QUOTES)). ')</span>' . '</li>';
I simply removed the two htmlspecialchars references. The same edit will be needed in the 'Link' and 'Dropdown' cases.PHP Code:
case 'Checkbox':
$filters .= '<li class="dFilterLink">' . zen_draw_checkbox_field($group . '[]', $attributes->fields['products_options_values_name'], (isset($_GET[$group]) && in_array($attributes->fields['products_options_values_name'],$_GET[$group]) ? true : false), ($linkClass == 'disabled' ? 'disabled="disabled"' : '') . ($onClick != '' && FILTER_STYLE == 'Checkbox - Single' ? ' onclick="' . $onClick . '"' : '')) . html_entity_decode($attributes->fields['products_options_values_name'], ENT_QUOTES) .' <span class="no_of_attributes">(' . html_entity_decode($attributes->fields['quantity'], ENT_QUOTES). ')</span>' . '</li>';
This allows html formatting of Option Values.
HOWEVER, this also raises a previous problem I had completely forgotten about, namely that the 'special' characters in html code such as < = " > / cause filtering errors i.e. 'There are no products to list in this category.', if I remove these characters then filtering with said Option Vale works as it should.
There was a post/edit made a while back regarding escaping special characters but I was never able to get it to work for these characters.
Thanks for that. I noticed this problem on a site I was working on a few weeks back, but I had other more important things to take care of at the time and never got back into looking for a solution.
I guess there is more interest than you expected eh? :-)
Thanks again
RodG
Hi Design75
Could you include the info about "How to update from old version" in the document?
I have a problem with the price filter shown as the image below.
Attachment 14681
zen: v1.5.3; DF: got from here
I had thought it would be a issue from error merging. After copying the DF files to zen cart directly, there is nothing change, even if I set the Enable Price filter to No.
other thing: I have not set tax.
Is anybody can help?
Thanks
It is a know bug i am working on right now. Better use the last version from the downloads section here
Thanks Design75
By the way, the 1.2bate is work on 1.5.1 version.
Hello,
I have the filter working on my site but have a problem.
It works great with existing attributes, but if I add an attribute and add it into 'include options' it shows up but returns no results when clicked on.
Any ideas? Thanks.
Is the filter can be enable on home page?