Re: Dynamic Filter [Support Thread]
Ok so first things first.
Do any of the files that have be overridden been modified by any of your other mods?
Secondly, starting to come back to me now. Pretty sure almost all if not all of the header files were out of date? Check the file version compared to the dynamic filter ones, I think I had to merge them.
Don't worry about cannonical, that doesn't do anything at this stage. All it will do is ensure that your canonical links in the source are correct when the filters are applied.
Re: Dynamic Filter [Support Thread]
Quote:
Originally Posted by
philip937
Ok so first things first.
Do any of the files that have be overridden been modified by any of your other mods?
I removed the only one that did, which was Products Listing Sorter v1.1
Secondly, starting to come back to me now. Pretty sure almost all if not all of the header files were out of date? Check the file version compared to the dynamic filter ones, I think I had to merge them.
Oh I have to look at that.
Don't worry about cannonical, that doesn't do anything at this stage. All it will do is ensure that your canonical links in the source are correct when the filters are applied.
ps. where can I get DrByte's Code revision?
Re: Dynamic Filter [Support Thread]
So you use the 1.5.1 file and change this function re written by DrByte
http://www.zen-cart.com/showthread.p...44#post1188244
That should be the only function in the file that is changed for dynamic filter and that version DrByte rewrote works fine for dynamic filter
Re: Dynamic Filter [Support Thread]
OK then in:
(1) Code from the mod - Creating the error and the white page.
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;
}
(2)DrBytes revision:
PHP Code:
function zen_get_all_get_params($exclude_array = 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 (!in_array($key, $exclude_array)) {
if (!is_array($value)) {
if (is_string($value) && strlen($value) > 0) {
$get_url .= zen_sanitize_string($key) . '=' . rawurlencode(stripslashes($value)) . '&';
}
} else {
foreach(array_filter($value) as $arr){
$get_url .= zen_sanitize_string($key) . '[]=' . rawurlencode(stripslashes($arr)) . '&';
}
}
}
}
}
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);
return $get_url;
}
(3)Code from my backup working site before Dynamic Filter
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;
}
I just have to replace (3) with (2)?
Re: Dynamic Filter [Support Thread]
Correct replace with (2) make sure you are doing this in a clean v1.5.1 functions general file
however I'm pretty sure that is not what is causing your error as I did not face the same thing. All this code change did was stopped some error log warnings.
I suspect that the problem is with other files that haven't merged properly.
You need to check the override files vs the version revisions of the 1.5.1 files they override. If they are older then they need to be merged. Will be going to bed very soon so won't be able to reply for a while. Just take it step by step one file at a time. The key is to ensure you are using the same files as version 1.5.1 uses and merge the changes dynamic filter makes.
On the plus side, I didn't find it hard to merge any of them apart from the functions general one to make it all good which DrByte kindly stepped in a did for us.
Re: Sorting Manufacturers on Dynamic Filter Sidebox
Phil You are the best. That did it.
It now works. No more white page. It seems to be functioning properly also. with no other revisions. I will let you know if I see other problems.
now I have to add the following to /includes/classes/shopping_cart.php line 1904-1906:
PHP Code:
// zen_redirect(zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'notify', 'main_page'))));
// zen_redirect(zen_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, zen_get_all_get_params(array('action', 'notify', 'main_page'))));
zen_redirect(zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'notify', 'main_page'))));
as DrByte recommends. Doctor knows best.
@DrByte, this revision should be it. Correct? And I should not have the following issue?
Quote:
Originally Posted by
DrByte
Ya, but now you may have problems with users creating accounts or resetting passwords etc.
Thank you DrByte.
Re: Sorting Manufacturers on Dynamic Filter Sidebox
Glad to hear it. Yes I will be adding that code also when I get around to it. The Dr knows best as you say. Glad you got it sorted. Still worth treble checking that all your files are up to date.
Take care :-)
Re: Sorting Manufacturers on Dynamic Filter Sidebox
Re: Sorting Manufacturers on Dynamic Filter Sidebox
I do not see the top category, but I see it filtered by Brand and Price (This top category does not have any sub-categories.)
PHP Code:
index.php?main_page=index&cPath=1
I do not see the top category, or any other filter in (This has sub-categories.)
PHP Code:
index.php?main_page=index&cPath=2
.
Is there any way to see all the categories including the top category filterable in the side box, in the filter area? As you see it in
PHP Code:
index.php?main_page=products_all
Re: Sorting Manufacturers on Dynamic Filter Sidebox
There are only various views when you see the category filter.
Products new and products all, probably search (though not got to testing that yet) and manufacturers pages.
There would be no point having filter by category when you are already viewing a category. Similarly on manufacters pages category filter shows but manufacters filter does not.