New Zenner
- Join Date:
- Jul 2012
- Location:
- Russia, Kazan
- Posts:
- 6
- Plugin Contributions:
- 0
Dynamic Filter [Support Thread]
Corrected. The subject is closed. There was a problem in absence many languages at the module.
Thanks to Andrey Berezin.
Views: 653,483
New Zenner
Corrected. The subject is closed. There was a problem in absence many languages at the module.
Thanks to Andrey Berezin.
Deceased
Hi,
Really nice module!
su35:
However, in the categories field, every category had been listed twice. I out put the $categories by print_() in tpl_dynamic_filter.php. It has been shown that every category had been double. Hope someone can help me to fix it.
tpl_dynamic_filter.php
Find:
$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");
Replace by
$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");
Find:
$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");
Replace by
$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");
NOTE: We are sorry that Andrew is no longer with us.
We are grateful for all his contributions to the Zen Cart community.
Deceased
Hi,
Nice module! Thanks!
Produced:
When choosing from the list of categories or attributes in filter doubles (tallies) of categories & options appear in the form of empty fields, and operations options are listed below;
Produced:
An error appears when sorting some of the categories
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), 'Y', 'N') as flag FROM manufacturers WHERE manufacturers_id IN (1,166,75,152)' at line 1
in:
[SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(), 'Y', 'N') as flag FROM manufacturers WHERE manufacturers_id IN (1,166,75,152) ORDER BY manufacturers_name]
Quick bugfix.
Find
```php
$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");
Replace by
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");
}
NOTE: We are sorry that Andrew is no longer with us.
We are grateful for all his contributions to the Zen Cart community.
New Zenner
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
Deceased
boby:
for diffrent attributes that show all languages traduction of attributes at all websites (languages)
http://www.zen-cart.com/showthread.php?195095-Dynamic-Filter-Left-Col-Boxes-Misaligned&p=1143369#post1143369
NOTE: We are sorry that Andrew is no longer with us.
We are grateful for all his contributions to the Zen Cart community.
New Zenner
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 !
Zen Follower
has any one got an answer to this?
New Zenner
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:
// 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
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?
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 donate to the Zen Team do you?
My current project: BestSewingDeals.com;
New Zenner
I'm getting the same error on zen cart 1.39 with Ceon Uri Mapping installed.
Haven't got a solution for this either...
Sensei
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.php?176804-PHP-Warning-strlen%28%29-expects-parameter-1-to-be-string&p=1136209#post1136209
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
New Zenner
DrByte:
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.php?176804-PHP-Warning-strlen%28%29-expects-parameter-1-to-be-string&p=1136209#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.
I donate to the Zen Team do you?
My current project: BestSewingDeals.com;
New Zenner
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
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);
I donate to the Zen Team do you?
My current project: BestSewingDeals.com;
New Zenner
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;
New Zenner
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
thanks a lot ;
New Zenner
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:
I donate to the Zen Team do you?
My current project: BestSewingDeals.com;
New Zenner
: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:
I donate to the Zen Team do you?
My current project: BestSewingDeals.com;
New Zenner
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
Sensei
boby:
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.php/Troubleshoot_-_Diagnosing_Obscure_Issues
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
New Zenner
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
New Zenner
DrByte:
Sounds like serious problems with your customized code and all the addons you've installed.
http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues
Thank you for your reply;
But That is so hard for me to merge all files of the site with the original !
Tell staff why this post should be reviewed.