Corrected. The subject is closed. There was a problem in absence many languages at the module.
Thanks to Andrey Berezin.
Printable View
Corrected. The subject is closed. There was a problem in absence many languages at the module.
Thanks to Andrey Berezin.
Hi,
Really nice module!
tpl_dynamic_filter.php
Find:
Replace byPHP 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) . ")" .
" ORDER BY categories_name");
Find:PHP 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");
Replace byPHP Code:
$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".
" JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES ." pov ON p2a.options_values_id = pov.products_options_values_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");
PHP Code:
$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");
Hi,
Nice module! Thanks!
http://www.zen-cart.com/showthread.p...69#post1143369
Quick bugfix.
Find
Replace byPHP Code:
$manufacturers = $db->Execute("SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(" . implode(',', $filteredManufacturers) . "), 'Y', 'N') as flag" .
" FROM " . TABLE_MANUFACTURERS .
" WHERE manufacturers_id IN (" . implode(',', $unfilteredManufacturers) . ")" .
" ORDER BY manufacturers_name");
PHP Code:
if (sizeof($filteredManufacturers) > 0) {
$manufacturers = $db->Execute("SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(" . implode(',', $filteredManufacturers) . "), 'Y', 'N') as flag" .
" FROM " . TABLE_MANUFACTURERS .
" WHERE manufacturers_id IN (" . implode(',', $unfilteredManufacturers) . ")" .
" ORDER BY manufacturers_name");
} else {
$manufacturers = $db->Execute("SELECT manufacturers_id, manufacturers_name, 'N' as flag" .
" FROM " . TABLE_MANUFACTURERS .
" WHERE manufacturers_id IN (" . implode(',', $unfilteredManufacturers) . ")" .
" ORDER BY manufacturers_name");
}
I have a multilinguage site using multisite addon to make for each language a diffrent site;
I sell rugs and I would like to install dynamic filter addon for having diffrent search results (by size, style, origin ...)
I installed this addon, but for diffrent attributes that show all languages traduction of attributes at all websites (languages)
for example, for the option size when I turn it to on, I will see at search pages, "size, mesure(french), tamaño(spanish), dimensioni(italian);
So at the sidebox I will have a list of search fields repeating the attributes in all languages;
Also I have the error
Warning: strlen() expects parameter 1 to be string, array given in /home/o112445/public_html/includes/functions/functions_general.php on line 153
and in top of header:
Warning: trim() expects parameter 1 to be string, array given in /home/o112445/public_html/includes/functions/functions_general.php on line 63
please can somebody help me to make this addon working with my multisite multilingue websites;
http://www.rugs-tapestries.com
http://www.tapis-tapisseries.com
http://www.tappeti-arazzi.it
http://www.alfombras-tapices.es
http://www.teppiche-wandteppiche.com
http://www.tapijten-wandtapijten.nl
http://www.farsh-ghali.ir
Thanks
Thank you a lot for your link ;
I made changes and the language problems seems to be resolved,
I have already this messages when I search products with dynamic filter sideboxes;;
in before results of products repeating the error message by:
Warning: strlen() expects parameter 1 to be string, array given in /home/o112445/public_html/includes/functions/functions_general.php on line 153
and in top of header:
Warning: trim() expects parameter 1 to be string, array given in /home/o112445/public_html/includes/functions/functions_general.php on line 63
how can I do for these errors ?
thank you again !
has any one got an answer to this?
I am using 1.5 and installed dynamic filter. I was checking the cache file for an error due to IH4 (since removed) but found this error repeated multiple times:
[20-Aug-2012 23:28:49 UTC] PHP Warning: strlen() expects parameter 1 to be string, array given in ... includes/functions/functions_general.php on line 153
Line 153 starts with the if statement for DF:
Is there something that needs to be edited within that section of code to stop the errors but allow the add-on to continue functioning?Code:// 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
Thank you!
Blessings,
Krisann
Currently installed:
Zen 1.5
Additional Product Images v 2_0c
Admin Display Product Catalog Thumb
Admin_Login_As_Customer_v3.0_For_ZCv150
Admin Notes Advanced
Admin Change PW Display
Backup MySQL plugin v5
Backup Zencart v1
Confirm Email Address 1.3a
Contact Us- add subject
contest system 1
Define Pages- shopping cart
Easy Attributes 1.3.91.5.0
Email for 404 v122
Fast Easy Checkout 1.5.0
Mailchimp 3.0
newsletter_discount_3.0
Piccadilly_Posh (template)
Recover Cart Sales
Rewards Points Full Suite 2.1.b
Save Sideboxes Layout
Button Construction
Dynamic Filter
Server OS: Linux 2.6.30.1-3.AM_64
Database: MySQL 5.0.51a-24-log
HTTP Server: Apache/2.2.11
PHP Version: 5.3.9 (Zend: 2.3.0)
PHP Memory Limit: 64M
PHP Safe Mode: Off
PHP File Uploads: On
Zen Cart 1.5.0
Database Patch Level: 1.5.0
v1.5.0 [2012-08-13 12:56:00] (Version Update 1.3.9->1.5.0)
v1.3.9h [2011-10-12 22:06:48] (Fresh Installation)
I'm getting the same error on zen cart 1.39 with Ceon Uri Mapping installed.
Haven't got a solution for this either...
Similar topic discussed here (but assumes the file is using ORIGINAL Zen Cart code, not alterations made by any addons): http://www.zen-cart.com/showthread.p...09#post1136209
Thank you, Dr. Byte. I did read that but was hoping someone could tell me how to fix it while keeping the add-on intact and I didn't want to hijack someone else's thread with something that seems add-on specific. :wink:
That particular fix has a LOT of code and I am great at copy paste but the editing gets pretty tricky unless someone tells me exactly what to edit. I have about a 2% understanding of how this stuff works, lol.
Blessings,
Krisann
*edited to add more detail.
Well, lol, I got it working without an error! I don't know if it is correct but it's working. :P
I added part of Dr. Byte's suggestion from the other thread, then commented out part of the DF mod. I didn't want to just delete stuff in case it messed up. I've sorted various pages using the filters without any errors in the cache file and so far I haven't seen any ill effects. If you (anyone reading this) notice something that is obviously a problem, please let me know so I can fix it. =) Thank you!
Blessings,
Krisann
Code:function zen_get_all_get_params($exclude_array = '', $search_engine_safe = true) {
if (!is_array($exclude_array)) $exclude_array = array();
//Bof Dr. Byte fix 1
$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
// }
// }
//Eof Dr. Byte fix 1
}
}
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);
Hi,
my dynamic filter works well when I search at "featured products" page, but when I search at other pages "products all, new products, categories, brands, and ..., that show error :
at top of page:
Warning: trim() expects parameter 1 to be string, array given in /home/o112445/public_html/includes/functions/functions_general.php on line 63
and at search results:
Warning: strlen() expects parameter 1 to be string, array given in /home/o112445/public_html/includes/functions/functions_general.php on line 153
can somebody help me ?
many thanks;
I had the same problem with my dynamic filter addon, and fixed it with the code at this page; many thanks;
but I have already another error at top of the page :
Warning: trim() expects parameter 1 to be string, array given in /home/o112445/public_html/includes/functions/functions_general.php on line 63
please can somebody help me to fix it also;
site: http://www.rugs-tapestries.com
example:
http://www.rugs-tapestries.com/produ...B%5D=&x=19&y=4
thanks a lot ;
Ok, that didn't work, lol! It caused major redirect errors when adding items to or deleting items from the shopping cart. :shocking:
Any suggestions? :blush:
:no: Sorry! I changed mine to just use the complete fix posted by Dr. Byte for now and suggest you do the same until we can get a real fix. Try adding something to your shopping cart... :yuck:
Thank you
I changed the cote to the fix dr byte posted to the thread, the error messages reduiced, but there are already one error message at the top of the page, for each search option choose, :
Warning: trim() expects parameter 1 to be string, array given in /home/o112445/public_html/includes/functions/functions_general.php on line 63
when I choose a category, and search,, the error message is one time, and when I choose a category and an other option like size, the error message is repeated two times at the top of the page;
thank you
Sounds like serious problems with your customized code and all the addons you've installed.
http://www.zen-cart.com/wiki/index.p...Obscure_Issues
Also when I search at all products page, for options, the searching result page show this error:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /home/o112445/public_html/includes/classes/db/mysql/query_factory.php on line 467
Perhaps.
But since the problem doesn't happen with original code, the most efficient way to find out where your specific problem exists is to do the comparison.
Thankfully automated tools like WinMerge make it simpler.
I have made a lot of changes and added a lot of addons to my sites (multisite addon also), from 2 or 3 years,
The update is made by someone who I found at freelancers site in india (I haven't a good experience with that),
So should I check all changes and for that I must remove and reinstalle each addon !
thanks
I have made a lot of changes and added a lot of addons to my sites (multisite addon also), from 2 or 3 years,
The update is made by someone who I found at freelancers site in india (I haven't a good experience with that),
So should I check all changes and for that I must remove and reinstalle each addon !
thanks
If you upgraded to 1.5.0 from any other version, you need to check EVERY add-on because some are not yet compatible. You probably should double check them all anyway but absolutely if you moved to 1.5.
Blessings,
Krisann
I ended up uninstalling the Dynamic Filter completely and reverting the functions_general.php file back to the zen-cart original because my CPU usage went through the roof. It was up to 88% yesterday. I'm lucky my hosting company is being really understanding and letting me sort through the trouble. If it isn't the DF mod that drove it up then it will most likely be something in IH4 because those were the last two mods installed when the CPU usage spiked. :blink:
Any other ideas about what it could be are greatly appreciated.
Blessings,
Krisann
CPU spikes are often caused by a "while" loop that's iterating through database results without specifying a MoveNext call ... resulting in an endless loop that spins out of control until the server kills it for running too long or killing CPU.
Thank you, I just wish I understood what that means, :blush:.
After removing the DF mod the cpu usage dropped back down to 3% so something in that mod was mis-configured. I think I misunderstood part of the directions and installed an extra jscrip.jquery file (it said to download it and rename it...). I'm just guessing though.
I re-installed IH4 and it seems to not be affecting the CPU negatively at all.
I'll live with the default filter for the time being. :wink:
Thank you!
Blessings,
Krisann
We have a customized Zen Cart 1.5 web site. We are trying to add the Dynamic Filter plugin.
From the following URL:
http://www.zen-cart.com/downloads.php?do=file&id=1361
We managed to get the filter choices (Price and Color) to be shown in the left sidebox, but the products were not displayed in the main part of the window.
The code in the 'template file overrides\includes\index_filters\MY_TEMPLATE' folder, in the file 'default_filter.php' does not display any products and presents the following error where the products would be listed:
WARNING: An Error occurred, please refresh the page and try again.
-----
We pasted the code for 'we show them all' from the existing 'default_filter.php' file into the new 'default_filter.php' file and got the products to list, but the filtering does not effect the list. Apparently the 'show them all' code is the only code that is being executed because of the filter conditions are not being met.
I have a link to a short video showing the product list does not change when the filter settings are changed.
http://screenr.com/B3J8
Below is the code that was pasted into our 'default_filter.php' file.
Below that is the 'We show them all' code that works from the old 'default_filter.php' file.
* We want to get the filtering code to work with the appropriate fields so that it references the field list and performs the sql query that shows the items that fit the filter selection.
Please provide a code fix so we can get the filter to work.
Filter code that does not work on our site.
-----
// bof dynamic filter 2 of 2
if (isset($_GET['filter_id']) && zen_not_null($_GET['filter_id']) || isset($_GET[DYNAMIC_FILTER_PREFIX . $categoryGroup])) {
// We are asked to show only a specific category
$listing_sql = "SELECT DISTINCT " . $select_column_list . " p.products_id, p.products_type, p.master_categories_id,
p.manufacturers_id, m.manufacturers_name, 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";
$listing_sql .= " FROM " . TABLE_PRODUCTS . " p" .
" LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id" .
" LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id" .
" LEFT JOIN " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id" .
" JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id" .
($filter_attr == true ? " JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " p2a on p.products_id = p2a.products_id" .
" JOIN " . TABLE_PRODUCTS_OPTIONS . " po on p2a.options_id = po.products_options_id" .
" JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on p2a.options_values_id = pov.products_options_values_id" .
(defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? " JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as on p.products_id = p2as.products_id " : "") : '');
$listing_sql .= " WHERE p.products_status = 1" .
" AND m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'" .
" AND pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
$filter .
" GROUP BY p.products_id " .
$having .
$alpha_sort;
} else {
// We show them all
$listing_sql = "SELECT DISTINCT " . $select_column_list . " 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";
$listing_sql .= " FROM " . TABLE_PRODUCTS . " p" .
" LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id" .
" LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id" .
" LEFT JOIN " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id" .
($filter_attr == true ? " JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " p2a on p.products_id = p2a.products_id" .
" JOIN " . TABLE_PRODUCTS_OPTIONS . " po on p2a.options_id = po.products_options_id" .
" JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on p2a.options_values_id = pov.products_options_values_id" .
(defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? " JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as on p.products_id = p2as.products_id " : "") : '');
$listing_sql .= " WHERE p.products_status = 1
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'" .
$filter .
" GROUP BY p.products_id " .
$having .
$alpha_sort;
}
} else {
// show the products in a given category
if (isset($_GET['filter_id']) && zen_not_null($_GET['filter_id']) || isset($_GET[DYNAMIC_FILTER_PREFIX . $manufacturerGroup])) {
// We are asked to show only specific manufacturer
$listing_sql = "SELECT DISTINCT " . $select_column_list . " 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";
$listing_sql .= " FROM " . TABLE_PRODUCTS . " p" .
" LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id" .
" LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id" .
" LEFT JOIN " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id" .
" JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id" .
($filter_attr == true ? " JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " p2a on p.products_id = p2a.products_id" .
" JOIN " . TABLE_PRODUCTS_OPTIONS . " po on p2a.options_id = po.products_options_id" .
" JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on p2a.options_values_id = pov.products_options_values_id" .
(defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? " JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as on p.products_id = p2as.products_id " : "") : '');
$listing_sql .= " WHERE p.products_status = 1" .
" and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
" and p2c.categories_id = '" . (int)$current_category_id . "'" .
$filter .
" GROUP BY p.products_id " .
$having .
$alpha_sort;
} else {
// We show them all
$listing_sql = "SELECT DISTINCT " . $select_column_list . " 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";
$listing_sql .= " FROM " . TABLE_PRODUCTS . " p" .
" LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id" .
" LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id" .
" JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id" .
($filter_attr == true ? " JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " p2a on p.products_id = p2a.products_id" .
" JOIN " . TABLE_PRODUCTS_OPTIONS . " po on p2a.options_id = po.products_options_id" .
" JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on p2a.options_values_id = pov.products_options_values_id" .
(defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? " JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as on p.products_id = p2as.products_id " : "") : '');
$listing_sql .= " WHERE p.products_status = 1
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p2c.categories_id = '" . (int)$current_category_id . "'" .
$filter .
" GROUP BY p.products_id " .
$having .
$alpha_sort;
}
}
// eof dynamic filter 2 of 2
-----
The working code for the 'We show them all' that is from the 'good' default_filter.php (file without the dynamic filter):
-----
// We show them all
$listing_sql = "select " . $select_column_list . " 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 " . TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p2c.products_id = s.products_id
where p.products_status = 1
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p2c.categories_id = '" . (int)$current_category_id . "'" .
$alpha_sort;
-----
Thank you
Dynamic Filter on two zencarts:
1. http://www.promdressesglobal.com/products_all.html
zc 1.5.0
All products shows minimum price at $20. This looks okay, except we don't have anything priced that low.
2. http://www.findmypromdress.com/all-products/
zc 1.3.9h
All products shows minimum price at $178. But this is not correct, as we have products at $99 and down to $69.
Now, our Quickship on this site does show lower prices, down to $58:
http://www.findmypromdress.com/quick...p-dresses-330/
$58 is more accurate, although we don't know where the filter is getting the $58
Questions:
1. Why the price difference in the filter results between Quickship and All Products?
2. How or where is the filter getting it's lowest price? (since we do not have prices that low.)
Thanks.
EDIT: Okay, we found the $20 price on the zencart 1.5 site where the filter works okay.
Still a problem on our main site - zencart 1.3.9h - where All Products is not picking up the lowest prices on the site:
http://www.findmypromdress.com/all-products/
Still shows lowest price as $178, but we have products at $69 as shown here:
http://www.findmypromdress.com/quick...p-dresses-330/
Our theory: price conscious customers will look at All Products then look for their price range in the filter, but it doesn't show lowest prices.
Thanks for any help.
Hello,
Here is my question I have just installed the dynamic filter plug-in which is fine the question is this how do I page over ride so that the left column or right column show on the pages with products but not the home page itself. Please help me with this!!
Id like to have no columns on home page but still have columns on the other pages!!
If you need to see the site:mysterydrawer.com (please be advised this is an adult products site)
Thank you for all your help and responses!!
Have a look at the documented file tpl_main_page.php
Make a copy for your template
You would then from your admin enable left & right columns and disable them for the home page in that file
Im sorry Im not seeing the code Im needing to do this function!!
/includes/templates/template_default/common/tpl_main_page.php
Copy to your custom template folder.
The comments at the top of the file describe numerous possible customized behavior tweaks. You may have to mix & match parts of the instructions for your particular situation. Look for $flag_disable_left etc.
Nevermind I found out what was wrong thank you for your help Kobra!! Thank you for your help as well gjh42!!
Have a question about the dynamic filter now it seems it is only filtering by price what do I need to do to setup other options. It does not say in the instructions!! Thanks
.......
Found some other issues with the filter.
Issue#1 - It does not appear to be working correctly from the All Products link.
We sell prom dresses. Customers will want to shop by style and color, not necessarily within a category of Designer. But when you click on All Products link and choose a read only attribute it does not bring up all the products that are assigned that attribute.
Example:
Go here and click on Many Beads or Sequins under By Other Features:
http://www.promdressesglobal.com/products_all.html (it takes quite a while to come up which is also a speed problem)
This is the result:
http://www.promdressesglobal.com/pro...s&disp_order=6
Only 24 products come up. There should be 206 products which is the number of products that include this attribute. Here is one that does not come up on the filter:
http://www.promdressesglobal.com/sho...1-p-12618.html (even thought you can see on the product page it does include this attribute.
Another thing I noticed is if you use the drop down at the top to Sort by Product, you still get on 24 products, but different products.
http://www.promdressesglobal.com/pro...s&disp_order=1
It appears that it is limiting to 24 products on this specific attribute on the filter. When I tested other attributes the number of products limit was different. So it's not just globally limiting All Products to 24 on the Filter. The limit changes depending on the Filter tested.
Issue# 2 - I noticed that when clicking on the filter High Low under By Length: section, it give the option to also choose Straight, A-Line and Fit and Flare under section By Skirt:
These are mutually exclusive. It can't be both High Low AND Straight. So it goes to a no products page. It really should not give the option to choose when there is no applicable product.
I hope you can help with this issue because I really like the filter but would like to use it on the All Products page.
I am actually the sister of SPH, the previous post.
Thank you,
Nancy Fallat
I see 6 $69.00 products on the first link ...
I see 6 $69.00 products on the second link ...
Did you fix this?
I thought I did by manipulating the Free price to show as $1 (set as something like $.50) to show from $1. But now I see All Products no longer shows lowest prices; perhaps due to my sister's filter to show lowest to highest price...don't know.
To clarify, we're speaking about the By Price filter in the left side-box, not our header3 banner.
Anyway, we're having further problem with the Dynamic Filter and All Products, as my sister recently posted here:
http://www.zen-cart.com/showthread.p...h-All-Products
It might be helpful if all Dynamic Filter posts could be in one support thread to easier locate and see any other issues and solutions.
can some one help me dynamic Filter mod is not working By Size: it comes up
WARNING: An Error occurred, please refresh the page and try again.
http://barkingstud.com/index.php?mai...ex&cPath=19_20
Check your /logs folder (or /cache for Zencart version 1.3.9) for error log files.
I installed dynamic filter on my 1.51 store yesterday, and it seems to work OK. Just been checking my usually empty logs and surprised that its very full. They are all the same and state:
[29-Oct-2012 09:32:56] 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 'order by' at line 7 :: select 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, products_description pd, manufacturers m
where p.products_status = 1
and pd.products_id = p.products_id
and pd.language_id = '1'
and p.manufacturers_id = m.manufacturers_id
and m.manufacturers_id = '1' order by pd.products_viewed DESC order by in /home/sites/xxxxxxxxx.co.uk/public_html/store/includes/classes/db/mysql/query_factory.php on line 120
Help please as this is totally over my head
Thanks
I guess its coming from the default_filter.php that I installed from the Dynamic Filter package. Hre are the suspect lines:
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
if (isset($_GET['alpha_filter_id']) && (int)$_GET['alpha_filter_id'] > 0) {
//$alpha_sort = " and pd.products_name LIKE '" . chr((int)$_GET['alpha_filter_id']) . "%' ";
$filterid = (int)$_GET['alpha_filter_id'];
switch($filterid)
{
case 1:
$alpha_sort = " order by pd.products_viewed DESC";
break;
case 2:
$alpha_sort = " order by p.products_price";
break;
case 3:
$alpha_sort = " order by p.products_price DESC";
break;
case 4:
$alpha_sort = " order by pd.products_name";
break;
case 5:
$alpha_sort = " order by p.products_ordered DESC";
break;
case 6:
$alpha_sort = " order by p.products_date_added DESC";
break;
case 7:
$alpha_sort = " order by p.products_date_added";
break;
}
} else {
$alpha_sort = " order by pd.products_viewed DESC";
$filterid = 1;
}
OK just noticed that before I installed this mod that the only thing in the filter by drop down box was 'items beginning with'
That is still there in the dropdown box, I dont think it should be, is it that that is causing the error?
Also noticed that the url at top of web browser shows:
main_page=index&cPath=6&sort=&alpha_filter_id=0
when first going to a category page, from the above default_filter.php there is no id=0
When the filter by box is used then the filter_id changes to a 1 or what ever filter is selected as defined in the .php
Hi everybody!
I just installed Dynamic Filter mod but I get a bunch of errors:
Warning: array_filter() expects parameter 1 to be array, string given in /includes/modules/MYTEMPLATE/dynamic_filter.php on line 15
Warning: in_array() expects parameter 2 to be array, string given in /includes/templates/MYTEMPLATE/sideboxes/tpl_dynamic_filter.php on line 210
Warning: in_array() expects parameter 2 to be array, string given in /includes/templates/MYTEMPLATE/sideboxes/tpl_dynamic_filter.php on line 279
Warning: in_array() expects parameter 2 to be array, string given in /includes/templates/MYTEMPLATE/sideboxes/tpl_dynamic_filter.php on line 298
Warning: in_array() expects parameter 2 to be array, string given in /includes/templates/MYTEMPLATE/sideboxes/tpl_dynamic_filter.php on line 298
A lot of the latest actually.
What could be wrong because I have no idea?
Thank you!
Thanks a_berezin.
How to make the filter appear above the product listing going horizontal? I am trying to place it where the stock product filter is.
Which product listing php file would I have to modify. I tried both the tpl_modules_product_listings (in template folder) and product_listing (in modules folder) and have not had luck getting it to show.
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
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.
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.
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?
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!
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?
macnerd,
Thanks for the suggestion but all my products have a status of 1. Any other ideas?
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!
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.
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.
Yes, I pm'ed the developer once on this plugin and he responded.
Although your site is attractive, I found it hard to know where I was when subcats are open. I've usually found the BetterCats plugin that Picaflor uses on her templates, and the little down-arrow, to be ineffective as a locator, especially when there are alot of subcats. And I typically don't rely on breadcrumbs.
So instead of being helpful as a locator, I find it often makes the categories/subcats column look too busy. And although attractive, I think there is a danger of your blue and gold looking too busy or hard to orient...don't know.
We also use Picaflor templates and on my main site here I went so far as to change link color when selected:
http://www.prommart.com/alyce-6748-p-910.html
I guess that was the main thing. But posting on the Reviewer's Corner is something even I should do.
Steve
Prommart.com
Fashion-Mart.biz
Thanks. I'll look into changing the color of the category when selected.
Howdy!
I installed Dynamic Filter and it seems to be working except for the filter sidebox headings. For example, instead of "By ", the DYNAMIC_FILTER_TEXT_PREFIX displays DYNAMIC_FILTER_TEXT_PREFIX. All of the headings do this. Here's the source of that part of the page:Can someone help me fix it? Thanks!Code:!--// bof: dynamicfilter //-->
<div class="leftBoxContainer" id="dynamicfilter" style="width: 150px">
<h3 class="leftBoxHeading" id="dynamicfilterHeading">BOX_HEADING_FILTER</h3>
<div id="dynamicfilterContent" class="sideBoxContent"><form name="product_filter_form" action="" method="get"><input type="hidden" name="cPath" value="65" /><hr width="90%" size="0" /><div><div class="dFilter"><p class="dFilterHeading">DYNAMIC_FILTER_TEXT_PREFIXDYNAMIC_FILTER_TEXT_PRICEDYNAMIC_FILTER_TEXT_SUFFIX</p><ul><li class="dFilterLink"><a class="enabled" rel="nofollow" href="http://192.168.1.117/menstore/jewelry/Silver_Jewelry?DYNAMIC_FILTER_PREFIXDYNAMIC_FILTER_PRICE_GROUP[]=51.75--62" >$52 and over</a></li></ul></div></div></ul></div></div><div id="dFilterClearAll"></div></form></div></div>
<!--// eof: dynamicfilter //-->
You look to have forgotten a language file when installing the mod.
~Melanie
Broke quite a few carts in my time :P
I have a bit of a problem that i could really use some help with....
Ok, somebody else was working on my sites admin and somehow managed to copy every attribute to every product, but only for the attributes that were dropdowns, the radio button ones were fine. He wasn't sure what he pressed that made that happen. I have resolved it now though after tediously deleting and then re-adding all the attributes we need.
The problem however lies now with the Dynamic Filter addon. It works fine with the radio button attributes that were left untouched by the previous error, but it will not work with any other attribute. I have done trial and error of moving products to different categories, renaming attributes etc....
I have narrowed the problem down, and i believe it to be that when i now add a new attribute to a product, it assigns that attribute with an id of around 32000. Even though i got rid of all the unwanted attributes, the id hasn't reset to a lower number.
I'm struggling to figure out how to rectify this problem. Is there any way of resetting all the attribute numbers so they start from 1 again? Even if i delete all the attributes and start again, the ids do not restart from 1 again. Maybe there is a way from phpmyadmin?
I have the Dynamic Filter working fine on another site, so im pretty sure this is the problem.
Any help would be greatly appreciated.
My site is www.drgreens.co.uk it is down for maintenance at the minute as i am redesigning it, but if anybody can help i can turn it back on.
Thanks in advance
That does sound like a database field size issue, and there should be a simple phpMyAdmin statement you can run to reset the id. Ajeh could probably give the best answer that doesn't leave any holes open or orphan data in your db.
in mysql, you can not order by a different field other than the group by field. as the group by already sort by it's filed.
but i don't know how to solve the problem.
Hello,
I tried this add-on in a 1.5.1 test-site. Like 'masterrusty' I also noticed the difference between the 1.5.0 and 1.5.1 core files.
I tried to merge the files but I don't know enough about php to get the job done. That's for sure!
Did anybody get this to work in 1.5.1.?
Thanx!
Did you just dropped the files or did you change code? If you made changes can you please explain what to do to make it work.
I will work when you just drop the files to the right places, after renaming the custom template folder names. However, it is better practice to compare the files on by one with existing files in your installation and merge the changes. All the edits that need to be made are clearly marked with comments by the author of the mod.
Right now I don't have the time to make an update for this mod, since I have about ten other (paid) projects that need to be finished this month ;)
There is one error in the installation pack the file "default_filter.php" in the folder "template file overrides\includes\index_filters\YOUR_TEMPLATE\" should be in "template file overrides\includes\index_filters".
There is no override for this file. If you have not made any changes to this file just overwrite it on your server.
Yes I did notice that de default_filter.php has to go directly in index-filter folder.
I've got the possibility for configuration. The problem is after installing the mod I get the message 'there are no products in this category' when I enter one of the categories. But I know they are there. Also there is no tool to filter. So now I have to figure out where it goes wrong.
Thanks you for reaction. It would be nice if you ever find some time for looking at this problem.
greetings
How can I get the "Sort By:' items to display in a row rather than a column? They are dropping the item display too far down the page.
Hello, my first post here:-)
I have installed this wonderfull mod. It is exactly wat i was looking for. I Have only one problem, it shows my options in two languages. I use two languages at my site, and like to use three in the end.
I Use a zen cart 151 fresh install, i added COWOA, Cookie_Control (is going to be deleted) super orders 5 final, creinhold_SBA5.1 alpha ect., ultimate seo urls, giftwrap, easy_populate,and catagory dressing.
Can someone help me out?
Thanks in advance and a happy new Year!! (-:
Maybe i'm the first encountering this problem? I have no clou where to begin, because the category id is the same in both languages... enfin, ill try and find a solution.
Products By Attributes with Dynamic Filter on v151
Anyone have both modules working together on 151 as there are a few files which clash?
Products by attributes installed successfully.
Dynamic Filter unsuccessful.
Reason: A number of files are clash when installed together.
The file /includes/functions/functions_general is the first. I believe there are four in total.
A comparison of the two files is below. Any assistance would be greatly appreciated.
FILTER BY ATTRIBUTES CODE (/includes/functions/functions_general)
PHP 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)) {
if (is_array($value) || in_array($key, $exclude_array)) continue;
if (strlen($value) > 0) {
$get_url .= zen_sanitize_string($key) . '=' . rawurlencode(stripslashes($value)) . '&';
}
}
}
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);
return $get_url;
}
DYNAMIC FILTER CODE(/includes/functions/functions_general)
PHP Code:
function zen_get_all_get_params($exclude_array = '', $search_engine_safe = true) {
if (!is_array($exclude_array)) $exclude_array = array();
$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 have installed this onto 1.5.1 and love it, works perfect! Only problem is the expand and collapse box feature isn't working at all, all settings are being ignored and is always fully expanded?
Anyone else had the same problem? Anyone able to suggest how to fault find it?
I have been through the docs and checked all the installations files are present and correct.
Thanks
Phil
really could do with some help here, ive checked the html markup to see if there are any template clashes but all looks ok to me.
whats weird is that the link for the expanding etc is in the code but not showing on the page:
<a class="dFilterToggle" href="#">More<img src="includes/templates/mytemplate/images/arrow_more.gif" alt="More" title=" More " width="10" height="10" class="dFilterToggleImg" /></a>
as a test I just took this code and pasted into an EZ page.. guess what still nothing showed on the page?
I have noticed there are two class elements class="dFilterToggle" & class="dFilterToggleImg"
is this normal? so at the moment I am unsure if it is the code above causing the problem, of the js not making the link appear??
Fixed. All very weird, bit of a clash with something else I use that needs jquery but seems one needs to load before CSS and one after.. Also both seem to need different flavours of jquery? Which I'm confused about, I thought putting the most up to date would cover both??
I am attempting to install the Dynamic Filter 1.1 mod on my site, but with no success. I have the site running on a test server. I attempted an install on my modified site and then a backup of a clean (non modded) install and get the following error on both, with the good ol' blank page:
PHP Fatal error: Cannot redeclare zen_create_random_value() (previously declared in C:\server\xammp\xampp\htdocs\gameovergames\includes\functions\functions_general. php:626) in C:\server\xammp\xampp\htdocs\gameovergames\includes\functions\password_funcs.php on line 86
I looked at both files but I'm a newbie to php, (working on it :smile:), and am not sure where to start to resolve the issue. Is this something I can resolve with coding or is the mod just not compatible with Zen 1.5.1? If so I may downgrade to 1.5.0 as I'm in desperate need of a module such as this.
Any suggestions would be great!
Can I bump this issue please, I'm suffering from it too.
I have used the Doc's solution posted here http://www.zen-cart.com/showthread.p...e-string/page4 for the issue ref line 153 but still can't resolve it for ref line 63.
Thanks
Hi folks.
As this thread appears to be supported the the clever maker of this handy mod I thought I mirror my issue here rather than duplicate posting.
If anyone gets a moment could you please have a quick look at my post here http://www.zen-cart.com/showthread.p...linguage-sites and the post that I have quoted from please as they too don't appear to have resolved.
Many thanks, and thanks for a great mod Damian.
At first I panicked as I thought this wasn't working with URI Mappings, however, I realised it only works with pages that have Been set with a non zen cart urls.
Ultimately I guess this isn't a problem if I set all pages that have a filter with a CEON URL but interested to know if there is a work around so it works on both types?
Thanks in advance.
Phil
Hello "fancie" Phil
Glad you got it sorted - I too am using this addon but could not find an official support thread for it !
Have you worked out how to remove price ?
price isn't something i need my customers to search on - just all the attributes that I am adding to the products as a read only.
2nd on my wish list is to pull this from being a sidebox to include in the main page ( category page ) so it would dynamically change for each different category but in the main page rather than on a sidebox.
Other than that loving it - keep it up Phil !
Hello crazycucumber!
Pretty sure you can just remove the price code from the template though I havent tried it.. no sure if it need 'blank' entries when a query is submitted on the form or if it will just be as if none were selected.
as for having different things on different categories, I would suggest you use the normal functionality of sideboxes and use IF statements based on the currenty category id and wrap it around your various boxes.. same aplies for this though I guess, if it needs all to be visible it wont work.
so in
includes/templates/your_template/sideboxes/tpl_dynamic_filter.php
try commenting out this code:
not tried and tested, so back up beofre you try..PHP Code:
/********************************************start price range link/check boxes***************************************************/
if (count($priceArray) > 0) {
$priceGap = floor(($max - $min) / (FILTER_MAX_RANGES - 1));
if (FILTER_MIN_PRICE > 0 && $priceGap < FILTER_MIN_PRICE) $priceGap = FILTER_MIN_PRICE;
if (FILTER_MAX_PRICE > 0 && $priceGap > FILTER_MAX_PRICE) $priceGap = FILTER_MAX_PRICE;
$group = DYNAMIC_FILTER_PREFIX . str_replace(' ', '', DYNAMIC_FILTER_PRICE_GROUP);
$resetParms[] = $group;
$parameters = zen_get_all_get_params();
$dropdownDefault = str_replace('%n', DYNAMIC_FILTER_PRICE_GROUP, DYNAMIC_FILTER_DROPDOWN_DEFAULT);
$priceCount = 0;
$prices = '';
for ($start = $min - 0.5; $start < $max; $start = $end + 0.01) {
$end = round($start + $priceGap);
if ($end < $max) $text = $currency_symbol . round($start * $conversion_rate) . ' -- ' . $currency_symbol . round($end * $conversion_rate);
else $text = $currency_symbol . round($start * $conversion_rate) . ' and over';
foreach($priceArray as $price ){
if ($start <= $price && $end >= $price) {
if (isset($_GET[$group]) && in_array($start . '--' . $end,$_GET[$group])) $linkClass = 'selected';
else $linkClass = 'enabled';
break;
} else $linkClass = 'disabled';
}
$onClick = '';
if (FILTER_GOOGLE_TRACKING != 'No') $onClick .= $trackingStart . '\'filterAction\', \'' . ($linkClass != 'selected' ? 'addFilter' : 'removeFilter') . '\', \'' . $pageName . ';' . DYNAMIC_FILTER_PRICE_GROUP . '=' . $start . '-' . $end . '\'' . $trackingEnd;
if (FILTER_STYLE == 'Checkbox - Single') $onClick .= ' this.form.submit();';
if (FILTER_METHOD != 'Hidden' || $linkClass != 'disabled') {
$hrefLink = $group . '[]=' . $start . '--' . $end;
switch(strtok(FILTER_STYLE, " ")) {
case 'Checkbox':
$prices .= '<li class="dFilterLink">' . zen_draw_checkbox_field($group . '[]', $start . '--' . $end, (isset($_GET[$group]) && in_array($start . '--' . $end,$_GET[$group]) ? true : false), ($linkClass == 'disabled' ? 'disabled="disabled"' : '') . ($onClick != '' && FILTER_STYLE == 'Checkbox - Single' ? ' onclick="' . $onClick . '"' : '')) . $text . '</li>';
break;
case 'Link':
$prices .= '<li class="dFilterLink"><a class="' . $linkClass . '"' . ($linkClass != 'disabled' ? ' rel="nofollow" href="' . zen_href_link($_GET['main_page'], ($linkClass != 'selected' ? $parameters . $hrefLink : str_replace(array($hrefLink,'&'.$hrefLink), array("",""), $parameters)), 'NONSSL') . '"' . ($onClick != '' ? ' onclick="' . $onClick . '"' : '') : '') . ' >' . $text . '</a></li>';
break;
case 'Dropdown':
$prices .= '<option value="' . $start . '--' . $end . '"' . ($linkClass == 'selected' ? ' selected="selected"' : '') . ($linkClass == 'disabled' ? ' disabled="disabled"' : '') . ($onClick != '' && FILTER_STYLE == 'Dropdown - Single' ? ' onclick="' . $onClick . '"' : '') . ' >' . $text . '</option>';
break;
}
}
++$priceCount;
}
$content .= '<hr width="90%" size="0" />';
$content .= '<div><div class="dFilter"><p class="dFilterHeading">' . DYNAMIC_FILTER_TEXT_PREFIX . DYNAMIC_FILTER_TEXT_PRICE . DYNAMIC_FILTER_TEXT_SUFFIX . '</p>';
if (isset($_GET[$group]) && array_filter($_GET[$group])) $content .= '<div class="dFilterClear"><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array($group)), 'NONSSL') . '">' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'clear_filter.png', DYNAMIC_FILTER_BUTTON_CLEAR_FILTER_ALT) . '</a></div>';
if (strtok(FILTER_STYLE, " ") == 'Dropdown') $content .= '<select name="' . $group . '[]" class="dFilterDrop"' . (FILTER_STYLE == 'Dropdown - Single' ? ' onchange="this.form.submit();"' : '') . '>' . '<option value=""' . (!isset($_GET[$group]) || !array_filter($_GET[$group]) ? ' selected="selected"' : '') . '>' . $dropdownDefault . '</option>';
else $content .= '<ul' . ($priceCount > FILTER_MAX_OPTIONS ? (FILTER_OPTIONS_STYLE == 'Scroll' ? ' class="dFilterScroll">' : ' class="dFilterExpand">') : '>');
$content .= $prices;
if (strtok(FILTER_STYLE, " ") == 'Dropdown') $content .= '</select>';
else $content .= '</ul>';
if (FILTER_OPTIONS_STYLE == 'Expand' && $priceCount > FILTER_MAX_OPTIONS) $content .= '<a class="dFilterToggle" href="#">More' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'arrow_more.gif', 'More', '', '', 'class="dFilterToggleImg"') . '</a>';
$content .= '</div></div>';
}
/********************************************end price range link/check boxes***************************************************/
Nope that broke the whole addon -
I just changed the first line to
so it is never true ! Seems to work.Code:if (count($priceArray) < 0) {
Now if I could get that info to appear where the category description normally sits , I would be on to a winner !
you should be able to include that file in the category template file where you want it, but you would need to do alot of style changin as assumably it will go from being vertical to horizantal?
Hope someone can help.
I thought all was going fine with dynamic filter.. well it kinda is as nothing is breaking as such front end but I am getting the following error throwing and hoping someone may be able to make sense of it?
the error is:
[03-Feb-2013 19:04:19 UTC] PHP Warning: strlen() expects parameter 1 to be string, array given in /home/website/public_html/includes/functions/functions_general.php on line 156
the code its referring to is:
Anyone know if this is a known bug? any one know how I can fix it?PHP Code:
// 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
Many Thanks
Phil
Blimey I think I fixed it!
where I had merged the older functions_general.php file with the new, I commented this:
it was just above the line that was throwing the error! with that in place it now doesnt error!PHP Code:
if (is_array($value) || in_array($key, $exclude_array)) continue;
:laugh:
oh nooooo. just realised although this seemed to stop the errors building up its now stopped the filter working when you navigate to page 2 of the results!!! anyone able to suggest anything??
This is kinda neat as it is a little annoying (to me at least) that manufacturers do not have sort orders and there fore can not be listed as per a sort order by default.
so if you're like me, here is a neat little fix that allows you to either sort ALL your manufactures of simply just bring a few to the top of the list (without having to rename them.)
lets assume that you have manufactures id's 1-5
1. Ford
2. Vauxhall
3. Audi
4. Seat
5. Honda
when displayed they will show in this order:
3. Audi
1. Ford
5. Honda
4. Seat
2. Vauxhall
but what if you wanted to have Honda at the top followed by Ford and then everything else..
here's how...
backup includes/templates/YOUR_TEMPLATE/templates/tpl_dynamic_filter.php
open up includes/templates/YOUR_TEMPLATE/templates/tpl_dynamic_filter.php
find this:
and replace with this:PHP Code:
$manufacturers = $db->Execute("SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(" . implode(',', $filteredManufacturers) . "), 'Y', 'N') as flag" .
" FROM " . TABLE_MANUFACTURERS .
" WHERE manufacturers_id IN (" . implode(',', $unfilteredManufacturers) . ")" .
" ORDER BY manufacturers_name");
so notice how we are replacing the standard ORDER BY manufacturers_name and now replacing it withPHP Code:
$manufacturers = $db->Execute("SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(" . implode(',', $filteredManufacturers) . "), 'Y', 'N') as flag" .
" FROM " . TABLE_MANUFACTURERS .
" WHERE manufacturers_id IN (" . implode(',', $unfilteredManufacturers) . ")" .
" ORDER BY FIELD(manufacturers_id,1,5) DESC");
ORDER BY FIELD(manufacturers_id,1,5) DESC
by doing this we are able to specify the field we wish to sort by, in this case manufacturers_id and then we specify the order starting with the one you want at the very top furthest away.
so in this format:
ORDER BY FIELD({FEILD ID},{forth...},{third},{second},{first}) DESC
so now the order would be:
5. Honda
1. Ford
followed by the rest..
Hope someone finds this of use! :smile:
It works, then it fails to function after clicking to test for filters. I get the white page.
I am getting the following error message:
[22-Feb-2013 21:50:56] PHP Fatal error: Cannot redeclare zen_create_random_value() (previously declared in
/home/content/******/html/****/cart/includes/functions/functions_general.php:626) in
/home/content/******/html/****/cart/includes/functions/password_funcs.php on line 86
Any idea where it's coming from?
Files were copied from the folder called "Installation for Zen Cart version 1.5.0" of mod "Dynamic Filter v1.0"
Is this mod not compatible with 1.5.1?
OK. I will merge the following with my previous files.
includes/functions/functions_general.php
includes/functions/password_funcs.php
and will let you know.
Apparently no one else has issues with Zen 1.5.1 and "Dynamic Filter v1.0"!