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?
Printable View
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"!