Zen Cart Logo
Forums / Addon Sideboxes / Dynamic Filter [Support Thread]

Dynamic Filter [Support Thread]

Views: 652,529

Results 601 to 620 of 809
29 Jun 2015, 2:57 AM
#601
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Dynamic Filter [Support Thread]

WWWD:

I am running 1.5.4

This line

// bof dynamic filter 1 of 2
include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_DYNAMIC_FILTER));
// eof dynamic filter 1 of 2

> 
> Produces this error:
> [27-Jun-2015 00:04:34 EST5EDT] [client 64.7.70.206 ] PHP Fatal error: Call to undefined function zen_get_module_directory() in /big/dom/xscholledresses/www/includes/classes/split_page_results.php on line 28
> 
> What is wrong?

what version of the module are you running?
4 Jul 2015, 6:33 PM
#602
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

solo_400:

I'm using 1.1 version of this module and ZC 1.5.0. I have also the price range issue like 18-98, 98-178, 178-278. Can you give me some hint how to get ranges like 0-100, 100-200, 200-300 ?

thx!

Did someone solve this issue ?

12 Jul 2015, 2:24 AM
#603
allanmarcus avatar

allanmarcus

New Zenner

Join Date:
Jul 2015
Posts:
5
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Any chance of a 1.5.4 compatible version?

12 Jul 2015, 4:59 AM
#604
allanmarcus avatar

allanmarcus

New Zenner

Join Date:
Jul 2015
Posts:
5
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I apologize for being dense, but I cannot get past how to install the plugin. I've installed ZC 1.5.1 and got it working. The instruction for installing Dynamic Filter are to:

New Files
Copy the includes folder from the 'new files' folder into your store's main directory.
The files are already in the correct directory structure, so a single drag-and-drop of the folder into the root directory for the store will put the files in the correct locations.
Please do not copy the files individually - doing so often results in files being missed out!

This makes no sense to me. If I drop the includes file into the root of the my catalog dir, it will overwrite the existing includes file. Wont that destroy my who catalog? Seems like I have to do exactly what the instructions say not to do; copy each file individually.

Please advise.

12 Jul 2015, 5:13 AM
#605
allanmarcus avatar

allanmarcus

New Zenner

Join Date:
Jul 2015
Posts:
5
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I decided to copy in the files manually. The instructions say to copy the following files:

includes/modules/pages/advanced_search_result/jscript_dynamic_filter.php
includes/modules/pages/featured_products/jscript_dynamic_filter.php
includes/modules/pages/index/jscript_dynamic_filter.php
includes/modules/pages/products_all/jscript_dynamic_filter.php
includes/modules/pages/products_new/jscript_dynamic_filter.php
includes/modules/pages/specials/jscript_dynamic_filter.php

Bu these are not in the distribution. Are they no longer needed and the Docs just not updated?

12 Jul 2015, 2:08 PM
#606
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Dynamic Filter [Support Thread]

AllanMarcus:

I apologize for being dense, but I cannot get past how to install the plugin. I've installed ZC 1.5.1 and got it working. The instruction for installing Dynamic Filter are to:

New Files
Copy the includes folder from the 'new files' folder into your store's main directory.
The files are already in the correct directory structure, so a single drag-and-drop of the folder into the root directory for the store will put the files in the correct locations.
Please do not copy the files individually - doing so often results in files being missed out!

> 
> This makes no sense to me. If I drop the includes file into the root of the my catalog dir, it will overwrite the existing includes file. Wont that destroy my who catalog? Seems like I have to do exactly what the instructions say not to do; copy each file individually. 
> 
> Please advise.
When you drag&drop the includes folder from the plugin into your store, that copy operation **adds **files present in the plugin's includes folder into your existing includes folder.  No existing files are deleted (although files of the same name will be replaced, usually with some overwrite verification).
12 Jul 2015, 10:59 PM
#607
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

chief:

here is a link to my amended "dynamic filter" which works with 1.5.4
http://www.tlsystems.co.uk/support/Zen-Cart_Dynamic_Attribute_filter-1.2-amended.zip

I have added a folder 1.5.4 to main archive, just follow instructions for previous versions.
take a backup of any files your going to overwrite.
rename the admin folder to yours
rename the YOUR_TEMPLATE folders to your template name
upload files
import sql
and it should work.
mine does, one thing to do is add a admin menu feature to show filter including tax "yes/no".

Thanks chief,

Just saw your post! Much appreciated. Will install with new ZC154 and test. :D

15 Jul 2015, 4:44 PM
#608
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Greetings,

Just installed chief's version for 1.5.4.

Question: I am only interested at this time in having the Dynamic Filter sidebox function on the product listing page (main_page=index). Do I still need to install the files in the includes\modules\pages? These seem to be for the search, featured, all, new and specials pages...

Thanks! :D

15 Jul 2015, 5:22 PM
#609
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Dynamic Filter [Support Thread]

kwright:

Greetings,

Just installed chief's version for 1.5.4.

Question: I am only interested at this time in having the Dynamic Filter sidebox function on the product listing page (main_page=index). Do I still need to install the files in the includes\modules\pages? These seem to be for the search, featured, all, new and specials pages...

Thanks! :D

No, you do not need them if you only want to use the filtering on the products listing.

15 Jul 2015, 11:32 PM
#610
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

No, you do not need them if you only want to use the filtering on the products listing.

Thanks Design75,

I have installed, except for those files. Filter sidebox displays with the correct filters and seem to be working!

21 Jul 2015, 1:45 PM
#611
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

Sorry to tell you, but currently the one column feature is not yet supported by this module. It is on my (very long) to do list, but I really can't promise any time frame. I you are haing some spare time, feel free to help with this module, and I'll add your code to it.

I've managed to get this mod to play happily with some responsive templates (stirling grand and westminster new) by using javascript to toggle the dynamicfilterContent on smaller responsive displays (I'm using max-width:767px).

Is this something you've got planned for the next release? If not, and you think it's worth it, would it help if I package it up and send it you for including in the mod?

21 Jul 2015, 1:54 PM
#612
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

simon1066:

I've managed to get this mod to play happily with some responsive templates (stirling grand and westminster new) by using javascript to toggle the dynamicfilterContent on smaller responsive displays (I'm using max-width:767px).

Is this something you've got planned for the next release? If not, and you think it's worth it, would it help if I package it up and send it you for including in the mod?

Greetings simon1066,

I would be interested in your mods for the westminster new template!

BTW, would you know how to only show the dynamic filter sidebox if there are products with attributes in a given category? It seems to display regardless and when there are no filters to list in the sidebox, it breaks the template layout!

Thanks!:D

21 Jul 2015, 2:01 PM
#613
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

kwright:

Greetings simon1066,

I would be interested in your mods for the westminster new template!

BTW, would you know how to only show the dynamic filter sidebox if there are products with attributes in a given category? It seems to display regardless and when there are no filters to list in the sidebox, it breaks the template layout!

Thanks!:D

Hi, what I can do is to deactivate the sidebox for a given category - is that what you are looking for?
I found it useful for document_general product category types - my template broke aswell!

21 Jul 2015, 2:45 PM
#614
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

simon1066:

Hi, what I can do is to deactivate the sidebox for a given category - is that what you are looking for?
I found it useful for document_general product category types - my template broke aswell!

Yes, but only for the categories that have products with no attributes! It seems that the default function of the dynamic filter sidebox is to always show in categories with products regardless if they have attributes or not (shows empty sidebox with heading text).

I guess one would need to test if a given category has products with attributes and show the filter sidebox if true. Just don't know where or how to do this? Any suggestions? I'm sure others would like this feature as well!

21 Jul 2015, 3:04 PM
#615
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Yes, I see what you mean, it would need a test to see if attributes are present. No doubt there's one hidden in the Zencart code somewhere. If you find it (or if you actually know the category that has no attributes) you can use this code to show/hide the sidebox for an 'if' statement

Replace the contents of includes/modules/sideboxes/YOUR_TEMPLATE/dynamic_filter.php with:

<?php
/**
 * dynamic_filter.php
 *
 *Zen Cart dynamic filter module
 *Damian Taylor, March 2010
 *
 */

if(FILTER_CATEGORY == 'Yes' && $current_page_base == 'index' && !$this_is_home_page && ($category_depth == 'products' || $category_depth == 'top') || FILTER_ALL == 'Yes' && $current_page_base == 'products_all' || FILTER_NEW == 'Yes' && $current_page_base == 'products_new' || FILTER_FEATURED == 'Yes' && $current_page_base == 'featured_products' || FILTER_SPECIALS == 'Yes' && $current_page_base == 'specials' || FILTER_SEARCH == 'Yes' && $current_page_base == 'advanced_search_result'){$show_dynamic_filter = true;
}
if ($cPath == '14'){
$show_dynamic_filter = false;}
if ($cPath == '6'){
$show_dynamic_filter = false;}
if ($show_dynamic_filter == true) {
  require($template->get_template_dir('tpl_dynamic_filter.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_dynamic_filter.php');

  $title =  BOX_HEADING_FILTER;
  $title_link = false;

  require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
?>

You can either change the [if ($cPath == '??')] value to your category or replace that code with the magical attribute test we've yet to find.

21 Jul 2015, 3:19 PM
#616
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

simon1066:

Yes, I see what you mean, it would need a test to see if attributes are present. No doubt there's one hidden in the Zencart code somewhere. If you find it (or if you actually know the category that has no attributes) you can use this code to show/hide the sidebox for an 'if' statement

Replace the contents of includes/modules/sideboxes/YOUR_TEMPLATE/dynamic_filter.php with:

<?php /** * dynamic_filter.php * *Zen Cart dynamic filter module *Damian Taylor, March 2010 * */ if(FILTER_CATEGORY == 'Yes' && $current_page_base == 'index' && !$this_is_home_page && ($category_depth == 'products' || $category_depth == 'top') || FILTER_ALL == 'Yes' && $current_page_base == 'products_all' || FILTER_NEW == 'Yes' && $current_page_base == 'products_new' || FILTER_FEATURED == 'Yes' && $current_page_base == 'featured_products' || FILTER_SPECIALS == 'Yes' && $current_page_base == 'specials' || FILTER_SEARCH == 'Yes' && $current_page_base == 'advanced_search_result'){$show_dynamic_filter = true; } if ($cPath == '14'){ $show_dynamic_filter = false;} if ($cPath == '6'){ $show_dynamic_filter = false;} if ($show_dynamic_filter == true) { require($template->get_template_dir('tpl_dynamic_filter.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_dynamic_filter.php'); $title = BOX_HEADING_FILTER; $title_link = false; require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default); } ?>
> 
> You can either change the [if ($cPath == '??')] value to your category or replace that code with the magical attribute test we've yet to find.

OK, I see now. Most likely would want to test since I have several categories that currently don't have any attributes, but may in the future. Also, by testing, would make the dynamic filter more universal for others. May be add an admin switch to not show sidebox when products with no attributes in a category exist.

I'll work on this to see what I can come up with. Also, still interested in your responsive mods if you have them available!

Thanks,
kwright
21 Jul 2015, 3:26 PM
#617
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Sounds good, adding an admin switch might be a bit beyond me though.

I'll put together a quick and dirty post on the responsive layout. I have found that there might still be a bit of work to finalise it - mainly that the filter collapses once an attribute is selected and it needs to be opened again to select another, you'll see what I mean though. I'll do it now and post shortly.

21 Jul 2015, 4:02 PM
#618
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Responsive template mods - this should put an expandable 'filter button' at the top of the product listing page on displays less than 767px width.


in includes/templates/YOUR_TEMPLATE/sideboxes/tpl_dynamic_filter.php

replace:

// draw filter form
  $content = '';
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
  $content .= zen_draw_form('product_filter_form','', 'get');

with:

// draw filter form
  $content = '';
  $content .= '<div id="filterToggle"><a href="javascript:;" onclick="toggle_visibility(\'dynamicfilterContent\');">' . zen_image_button(BUTTON_IMAGE_TOGGLE_FILTER, BUTTON_TOGGLE_FILTER_ALT, 'class="listingBuyNowButton"') . '</a></div>';
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
  $content .= zen_draw_form('product_filter_form','', 'get');

in your responsive.css or responsive_default.css file (depending on the template used) add under the @media (max-width:767px) section add:

#dynamicfilter { display: block;visibility: visible;}
#dynamicfilterContent{display:none;}
#filterToggle {display: block;margin: 18px 0 0;}
#dynamicfilterHeading {display: none;}

in stylesheet.css add:

#filterToggle {display:none;}

in includes/languages/english/YOUR_TEMPLATE/button_names.php add:

define('BUTTON_IMAGE_TOGGLE_FILTER', 'buttonimage.gif');
define('BUTTON_TOGGLE_FILTER_ALT', 'Filter results');

BUTTON_TOGGLE_FILTER_ALT as well as being the image alt tag is also used for the css button text.
BUTTON_IMAGE_TOGGLE_FILTER is an image file of the button if using images, if using css buttons this is not required but should be left blank like:

define('BUTTON_IMAGE_TOGGLE_FILTER', '');

in /includes/modules/pages/index add the attached jscript_toggle.js

Attachment #15441


and that's it.

simon1066:

... I have found that there might still be a bit of work to finalise it - mainly that the filter collapses once an attribute is selected and it needs to be opened again to select another, you'll see what I mean though.

Now I come to think about it might be acceptable or even desirable for the filter box to collapse on page refresh especially on small screens. It would be good to know what others think.

21 Jul 2015, 8:55 PM
#619
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Thanks simon1066 for your help and mods!:clap:

30 Jul 2015, 1:56 AM
#620
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Greetings,

Thinking it would be a good feature, I would like to add an additional "Narrow Results By Products In Stock" feature to the sidebox. Looking through the tpl_dynamic_filter.php file, I'm a bit confused as to where and how I would add this?

Code suggestions?

Thanks