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

Dynamic Filter [Support Thread]

Views: 652,521

Results 681 to 700 of 809
12 Aug 2016, 7:42 PM
#681
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Dynamic Filter [Support Thread]

soxophoneplayer:

I'm playing with this mod on my WAMP test site, zc 1.5.5a with Responsive Sheffiled Blue and many mods.

On the install.sql - the big chunk at the beginning of this file installs via phpMyAdmin. But I get error on the last bit for zencart 1.5 mods.

Specifically, the values for main_page_parms and sort order.

DELETE FROM zen_admin_pages WHERE page_key='configDynamicFilter';
INSERT INTO zen_admin_pages (page_key,language_key,main_page,page_params,menu_key,display_on_menu,sort_order) VALUES ('configDynamicFilter','BOX_CONFIGURATION_DYNAMIC_FILTER','FILENAME_CONFIGURATION',CONCAT('gID=',@cid), 'configuration', 'Y', @cid);

> 
> My zen_config_group installed from the first part of sql has config group id and sort order of 2828. I tried substituting those values in place of the @cid, to no avail. 
> 
> There are no extra columns in my zen_admin_pages. 
> 
> Initial error msg was those values (as in install.sql) can't be null.  Attempt to insert the 2828 gives syntax error.

Got this more or less sorted...in the page_params I changed CONCAT('gID=',@cid) to gID=2828 instead of just 2828 and that worked.

So I got this mod fired up in zc 1.5.5a to the extent that everything shows up in the admin page but I'm not functional with it yet which I think is more related to how I've got my categories and attributes (lack of) set up - not directly related to this forum so I'll pursue that aspect elsewhere.
13 Aug 2016, 5:57 PM
#682
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

[QUOTE=soxophoneplayer;1317043]Got this more or less sorted.../QUOTE]

Just to confirm for anyone interested - I have this mod working with zc 1.5.5a and Responsive Sheffiled Blue. A bit of fiddling with the sql as noted above, and a couple of the file merges were semi-tricky as files were already modified by the template.

I'm using this mod with Stock By Attributes, the github fileset from June 2016.

I've tested right through to checkout (not payment) stage and am still only on my test WAMP site.

14 Sep 2016, 4:27 PM
#683
justrimless avatar

justrimless

Zen Follower

Join Date:
Aug 2006
Posts:
127
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

Yes there is. And a similar thing was already in a test version for "text" and "file" types

locate includes/modules/sideboxes/YOUR_TEMPLATE/dynamic_filter.php and find the lines

$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");
> and change them to
> ```php
    $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" : "") . "
                                AND po.products_options_type != '1'
                                AND po.products_options_type != '4'
                                GROUP BY po.products_options_name, pov.products_options_values_name
                                ORDER BY po.products_options_name, pov.products_options_values_sort_order");

this eliminates file and text.

If you want to add readonly to that list:

$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" : "") . "
                            AND po.products_options_type != '1'
                            AND po.products_options_type != '4'
                            AND po.products_options_type != '5'
                            GROUP BY po.products_options_name, pov.products_options_values_name
                            ORDER BY po.products_options_name, pov.products_options_values_sort_order");

Hello, I asked whether it was possible to omit read only attributes from the results and you kindly provided the above solution, many thanks.
(A year to the day it seems!)

But I cannot find the lines you mention in order to change them?

Thanks in advance for any help.
23 Sep 2016, 5:29 PM
#684
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

zc 1.5.5a, Responsive Sheffield Blue, Dynamic Filters and many mods.

Is there a way to change filtering within the values of an option name to AND from OR?

Example - I have an Option Name - Fibre, and Values Merino, Nylon, Cotton, etc. Using check boxes in DF, if I select both Merino and Nylon boxes I get a filtered list that has either Merino , OR Nylon - I'd prefer to get a result that includes only those with both Merino AND nylon. I can hack around this by creating another value called Merino-Nylon, but would prefer scenario I mention.

23 Sep 2016, 6:08 PM
#685
design75 avatar

design75

Totally Zenned

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

Re: Dynamic Filter [Support Thread]

soxophoneplayer:

zc 1.5.5a, Responsive Sheffield Blue, Dynamic Filters and many mods.

Is there a way to change filtering within the values of an option name to AND from OR?

Example - I have an Option Name - Fibre, and Values Merino, Nylon, Cotton, etc. Using check boxes in DF, if I select both Merino and Nylon boxes I get a filtered list that has either Merino , OR Nylon - I'd prefer to get a result that includes only those with both Merino AND nylon. I can hack around this by creating another value called Merino-Nylon, but would prefer scenario I mention.

I understand what you want, but I am not sure it is easy to achieve.

24 Sep 2016, 12:30 PM
#686
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

I understand what you want, but I am not sure it is easy to achieve.

Thanks. I can work around it. But I had to ask - I'd have felt a real fool to find out after the fact that I could have changed OR to AND in one line of code ;o)

18 Oct 2016, 9:40 PM
#687
icecold avatar

icecold

Zen Follower

Join Date:
Jul 2008
Posts:
360
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I'm using dynamic filters with ZC 1.5.3 and I'm migrating, rebuilding my store to ZC 1.5.5a with 1.5.3 I have several problems such as the price filtering not filtering within the assigned range, for instance I have a filter in place $1--$25 for some reason it leaks prices ABOVE it ... still couldn't find a way to solve it ...

4 Nov 2016, 10:04 AM
#688
wrickspam avatar

wrickspam

New Zenner

Join Date:
Dec 2011
Location:
Emmen, The Netherlands
Posts:
85
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

icecold:

I'm using dynamic filters with ZC 1.5.3 and I'm migrating, rebuilding my store to ZC 1.5.5a with 1.5.3 I have several problems such as the price filtering not filtering within the assigned range, for instance I have a filter in place $1--$25 for some reason it leaks prices ABOVE it ... still couldn't find a way to solve it ...

it uses the prices + tax, is that the leak you mean ?

22 Nov 2016, 3:22 AM
#689
su35 avatar

su35

Zen Follower

Join Date:
Oct 2011
Posts:
168
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

purpose: show all product list on main page
solution: in define_main_page.php add
require(DIR_WS_MODULES . zen_get_module_directory('pages/products_all/header_php.php'));
require($template->get_template_dir('/tpl_products_all_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_products_all_default.php');
result: all product list shown on main page
problem: the content of the filter is disappeared.

1 Dec 2016, 4:47 PM
#690
icecold avatar

icecold

Zen Follower

Join Date:
Jul 2008
Posts:
360
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

wrickspam:

it uses the prices + tax, is that the leak you mean ?

Well no what I meant was prices(advertised prices), like let's say there was a tier between 10-20 well I see products that supposed to be filtered, like with $21 and even above prices ...

3 Dec 2016, 8:08 PM
#691
chadlly2003 avatar

chadlly2003

Totally Zenned

Join Date:
Jan 2015
Posts:
740
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Zencart 1.5.4
Zen-Cart_Dynamic_Attribute_filter-1.3

I was getting an error on my sql file. I used the code below found in the thread to make Dynamic filters SQL file work

// 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" .
   " 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

Now I have an error when I do a search. I need assistance with solving this error below if someone could assist me...

[03-Dec-2016 14:51:00 America/New_York] PHP Fatal error: 1054:Unknown column 'in_name' in 'order clause' :: SELECT p.products_id, p.products_price_sorter, p.master_categories_id, p.manufacturers_id FROM products p LEFT JOIN manufacturers m USING(manufacturers_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 categories c on p2c.categories_id = c.categories_id LEFT JOIN meta_tags_products_description mtpd ON mtpd.products_id= p2c.products_id AND mtpd.language_id = 1 WHERE (p.products_status = 1
AND pd.language_id = 1 AND ((pd.products_name LIKE '%aims%'
OR p.products_model
LIKE '%aims%'
OR m.manufacturers_name
LIKE '%aims%' OR (mtpd.metatags_keywords
LIKE '%aims%'
AND mtpd.metatags_keywords !='') OR (mtpd.metatags_description
LIKE '%aims%'
AND mtpd.metatags_description !='') OR pd.products_description
LIKE '%aims%') and (pd.products_name LIKE '%power%'
OR p.products_model
LIKE '%power%'
OR m.manufacturers_name
LIKE '%power%' OR (mtpd.metatags_keywords
LIKE '%power%'
AND mtpd.metatags_keywords !='') OR (mtpd.metatags_description
LIKE '%power%'
AND mtpd.metatags_description !='') OR pd.products_description
LIKE '%power%') )) GROUP BY p.products_id order by in_name DESC, p.products_sort_order, pd.products_name ==> (as called by) C:\xampp\htdocs\xxx.com\includes\templates\theme871\sideboxes\tpl_dynamic_filter.php on line 63 <== in C:\xampp\htdocs\xxx.com\includes\classes\db\mysql\query_factory.php on line 292

4 Dec 2016, 8:42 PM
#692
chadlly2003 avatar

chadlly2003

Totally Zenned

Join Date:
Jan 2015
Posts:
740
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Okay I solved my issue with 1054:Unknown column 'in_name' in 'order clause. I had a module called Search: Prioritize Matching Names
that needed to be disabled.

The issue that remains for some reason when I do a search. It shows the category filters and brand but not showing the pricing filter. How do I get the price filter to populate?

If someone could assist me or lead me in the right direction I would appreciate it.

6 Dec 2016, 7:31 PM
#693
chadlly2003 avatar

chadlly2003

Totally Zenned

Join Date:
Jan 2015
Posts:
740
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Zencart 1.5.4
Issue (Dynamic Filter) ver 1.3

I have downloaded the dynamic filter plugin for Zen cart. I did see the post regarding this module but it seems not be active.
https://www.zen-cart.com/showthread....Support-Thread

I was wondering if someone can assist me. I currently installed the module and all seems good. The only issue I have is for some reason the price range is not displaying. Can someone assist me or lead me in the right direction in solving this issue. I am not sure if the pricing is based on the product price or attribute price.

21 Dec 2016, 5:40 PM
#694
valnoren2 avatar

valnoren2

New Zenner

Join Date:
Oct 2015
Posts:
1
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Is this plugin dead I am having issue with installing it and getting it to work with 1.5.5b. I had it working briefly with 1.5.5a but the sidebar stopped displaying after I updated then I tried to revert it and now still nothing works.

21 Dec 2016, 8:05 PM
#695
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

valnoren2:

Is this plugin dead I am having issue with installing it and getting it to work with 1.5.5b. I had it working briefly with 1.5.5a but the sidebar stopped displaying after I updated then I tried to revert it and now still nothing works.

I have this mod working with zc 1.5.5b. The price filter was wonky so I turned it off. I read on this forum that price was always wonky. Also read this: https://www.zen-cart.com/showthread.php?193289-Dynamic-Filter-Support-Thread&p=1260429&highlight=forbidden#post1260429 but I haven't pursued it further as price filter wasn't big issue of me as much as the other filters.

I did find that the mod didn't play nice with Stock by Attributes. I only had a few items using that mod so I uninstalled it and then, with price filter turned off, everything works fine for me.

16 Feb 2017, 2:47 AM
#696
ttfan avatar

ttfan

Zen Follower

Join Date:
Jul 2010
Location:
Australia
Posts:
231
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I really love the looks of this module, and feel I need it for my site, but I don't think I have the software skills to get it working, juding by some of the issues discussed in this thread.
I'm running ZC 1.5.5d with a Responsive Sheffield Blue V 2.0 template. Can someone recommend an experience person that I can pay to get it installed & working?

16 Feb 2017, 8:45 AM
#697
design75 avatar

design75

Totally Zenned

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

Re: Dynamic Filter [Support Thread]

The module is working on Zen Cart 1.5.5d, as can be seen here on my dev site. I'll try to answer in this thread more often in the future, as the past year has been pretty busy.
I'll also try to release an updated version with some fixes for open issues.

16 Feb 2017, 3:10 PM
#698
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

The module is working on Zen Cart 1.5.5d, as can be seen here on my dev site. I'll try to answer in this thread more often in the future, as the past year has been pretty busy.
I'll also try to release an updated version with some fixes for open issues.

I love this mod and am also using it on zc 1.5.5d and Responsive Sheffield Blue

I am unable to filter by price without errors - a post on this forum suggests a solution involving settings by site host, which I 'intend' to follow up. Its not a pressing issue for my situation.

I use the filters on my desktop site. My template has mobile setting that I was able to fiddle to allow the filters to appear on mobile, but I turned it off as it opened 'full out' taking up all the the initial screen. An ask for future development would be ability to have a 'filters tab/menu' that was closed by default but could be clicked open - therefore not occupying full screen when site is loaded.

The mod doesn't play nice (for me) with Stock by Attributes mod. Wasn't a big issue for me as I only had a few products using that mod and I just split those products into separate product for each attribute.

This is a great mod that I think made a huge improvement to my site. Thanks for your work!

16 Feb 2017, 3:41 PM
#699
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

The module is working on Zen Cart 1.5.5d, as can be seen here on my dev site.

A quick test on the "dev site" gave the following results.

Does not work using links for: All Products, New Products, Featured Products, Specials
-> gives a broken page with this msg: WARNING: An Error occurred, please refresh the page and try again.

Does work with Search results and most any other page I tried.

The "more" link at the bottom of certain options does slide down and shows more blank space.

16 Feb 2017, 5:52 PM
#700
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Website Rob:

A quick test on the "dev site" gave the following results.

Does not work using links for: All Products, New Products, Featured Products, Specials
-> gives a broken page with this msg: WARNING: An Error occurred, please refresh the page and try again.

Does work with Search results and most any other page I tried.

The "more" link at the bottom of certain options does slide down and shows more blank space.

I don't use 'all products' on my site, but the filters do work on new, featured, and specials. Maybe not coded in on the dev site?

Looking over my notes, I recall empty categories generated an error and would mangle the page style. Solution was simple - no empty categories.

Also noted from notes that using this mod with the Responsive Sheffield Blue 2.0 generated log errors that traced to the currencies mod that was part of the template. Didn't seem to affect function of the site, but to be safe I stripped out the currencies files and replaced with R Barbour currencies mod. No errors generated.

A bit of a tweak I did with the filters - the filtered attribute names of a product showed up on the 'add to cart' box on the product page. Some products had more or fewer attributes which affected the look/size of the page. Rather than just display:none them, I cut out the code that generated this feature and pasted it in one the the product description tabs resident in the template (that I previously had turned off as I wasn't using it). With a little css tweaking I think it came out as a nice lateral feature of the filters mod.