Results 1 to 10 of 809

Hybrid View

  1. #1
    Join Date
    Nov 2004
    Posts
    364
    Plugin Contributions
    0

    Default Re: Dynamic Filter - filter does not work on product listing

    Quote Originally Posted by Design75 View Post
    I do not have a new update ready yet, but am working on it.
    I already have this module running on a live 1.5.3 shop, and there seem to be no problems.

    With a bit of luck I can round this one up at the en of this week
    Much appreciated Design75,

    I'm looking forward to installing your updated version on 1.5.3!

    Side question: How would one go about creating filters based on a sets of keywords (custom filters). Maybe include the meta tag data in the generation of the filters? or is this already part of this mod?

    Thanks
    Experience is what you get when you don’t get what you want…

  2. #2
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: Dynamic Filter - filter does not work on product listing

    Quote Originally Posted by kwright View Post
    Much appreciated Design75,

    I'm looking forward to installing your updated version on 1.5.3!

    Side question: How would one go about creating filters based on a sets of keywords (custom filters). Maybe include the meta tag data in the generation of the filters? or is this already part of this mod?

    Thanks
    Your welcome , I have no idea about custom filters. Never considered it.
    This module is for me also still a hard one to understand how it is exactly working.
    The new release will at least contain the next changes:

    - backwards compatibility with versions < zc 1.5.3 will be dropped.
    - complete module will be multi lingual
    - did some code cleaning and moving from template files to module files
    - added an optional product count behind every option

    I am trying to fix a tax problem, because now price-ranges are only shown/calculated without tax

  3. #3
    Join Date
    Nov 2004
    Posts
    364
    Plugin Contributions
    0

    Default Re: Dynamic Filter - filter does not work on product listing

    Quote Originally Posted by Design75 View Post
    Your welcome , I have no idea about custom filters. Never considered it.
    This module is for me also still a hard one to understand how it is exactly working.
    The new release will at least contain the next changes:

    - backwards compatibility with versions < zc 1.5.3 will be dropped.
    - complete module will be multi lingual
    - did some code cleaning and moving from template files to module files
    - added an optional product count behind every option

    I am trying to fix a tax problem, because now price-ranges are only shown/calculated without tax
    Very nice. I'll be happy to test your combined updates on the 1.5.3 site I'm developing. Once you make the updates available, I'll try my hand at adding data from the meta tags product description table or maybe custom product fields as part of the filter options.

    I have a few sites that could really use this functionality since the products don't have attributes, but could still benefit from filters.
    Experience is what you get when you don’t get what you want…

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Dynamic Filter - filter does not work on product listing

    Quote Originally Posted by Design75 View Post
    I am trying to fix a tax problem, because now price-ranges are only shown/calculated without tax
    This may help (changes in blue) :

    // File /modules/custom/dynamic_filter.php
    ------------------------------------------------------------
    / Price Range/Attribute filter
    $manufacturerGroup = str_replace(' ', '', DYNAMIC_FILTER_MANUFACTURER_GROUP);
    $categoryGroup = str_replace(' ', '', DYNAMIC_FILTER_CATEGORY_GROUP);
    $priceGroup = str_replace(' ', '', DYNAMIC_FILTER_PRICE_GROUP);
    $prvKey = '';
    $prvHaving = '';
    $filter = '';
    $having = '';
    $filter_attr = false;


    reset($_GET);
    while(list($key, $value) = each ($_GET)) {
    // if(!is_array($value)) { // skip if not array // RodG

    if(substr($key,0,strlen(DYNAMIC_FILTER_PREFIX)) == DYNAMIC_FILTER_PREFIX && array_filter($value)) {
    $key = str_replace(DYNAMIC_FILTER_PREFIX, '', $key);
    foreach ($value as $value) {

    if($key == $manufacturerGroup || $key == $categoryGroup || $key == $priceGroup) {
    if($key != $prvKey) {
    if($prvKey != '') {
    $filter .= ') and (';
    } else {
    $filter .= ' and (';
    }
    } else {
    $filter .= ' or ';
    }
    }
    // manufacturer
    if($key == $manufacturerGroup) {
    $filter .= "m.manufacturers_id = '" . (int)$value . "'";
    $prvKey = $key;
    // category
    } else if($key == $categoryGroup) {
    $filter .= "p2c.categories_id = '" . (int)$value . "'";
    $prvKey = $key;
    // price range
    } else if($key == $priceGroup) {
    list($low,$high) = explode("--",$value);
    // Updated to include GST by RodG
    $filter .= 'p.products_price_sorter>=' . ($low - ($low / 11)) . ' and ' . 'p.products_price_sorter<=' . ($high - ($high / 11));
    // $filter .= 'p.products_price_sorter>=' . $low . ' and ' . 'p.products_price_sorter<=' . $high; // original code //
    $prvKey = $key;
    // attributes
    } else {
    if($key != $prvHaving) {
    if($prvHaving != '') {
    $having .= ') and (';
    } else {
    $having .= 'HAVING (';
    }
    } else {
    $having .= ' or ';
    }
    $having .= ' FIND_IN_SET("' . $key . $value . '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))';
    $filter_attr = true;
    $prvHaving = $key;
    }
    }
    }
    //}
    }
    if($filter != '') $filter .= ')';
    if($having != '') $having .= ')';
    if($filter_attr == true && defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK')) $filter .= ' AND p2as.quantity > 0 AND FIND_IN_SET(p2a.products_attributes_id, p2as.stock_attributes)';

    --------------------------------------------------------------------------------------------------------

    OK, so it isn't going to be *exactly* what you want. This was a quick n dirty fix I added to a customers site to account for a 10% GST.
    It shouldn't be hard to replace these hard coded calculations with variables obtained from the Tax tables though.

    Cheers
    RodG

  5. #5
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: Dynamic Filter - filter does not work on product listing

    Quote Originally Posted by RodG View Post
    This may help (changes in blue) :

    // File /modules/custom/dynamic_filter.php
    ------------------------------------------------------------
    / Price Range/Attribute filter
    $manufacturerGroup = str_replace(' ', '', DYNAMIC_FILTER_MANUFACTURER_GROUP);
    $categoryGroup = str_replace(' ', '', DYNAMIC_FILTER_CATEGORY_GROUP);
    $priceGroup = str_replace(' ', '', DYNAMIC_FILTER_PRICE_GROUP);
    $prvKey = '';
    $prvHaving = '';
    $filter = '';
    $having = '';
    $filter_attr = false;


    reset($_GET);
    while(list($key, $value) = each ($_GET)) {
    // if(!is_array($value)) { // skip if not array // RodG

    if(substr($key,0,strlen(DYNAMIC_FILTER_PREFIX)) == DYNAMIC_FILTER_PREFIX && array_filter($value)) {
    $key = str_replace(DYNAMIC_FILTER_PREFIX, '', $key);
    foreach ($value as $value) {

    if($key == $manufacturerGroup || $key == $categoryGroup || $key == $priceGroup) {
    if($key != $prvKey) {
    if($prvKey != '') {
    $filter .= ') and (';
    } else {
    $filter .= ' and (';
    }
    } else {
    $filter .= ' or ';
    }
    }
    // manufacturer
    if($key == $manufacturerGroup) {
    $filter .= "m.manufacturers_id = '" . (int)$value . "'";
    $prvKey = $key;
    // category
    } else if($key == $categoryGroup) {
    $filter .= "p2c.categories_id = '" . (int)$value . "'";
    $prvKey = $key;
    // price range
    } else if($key == $priceGroup) {
    list($low,$high) = explode("--",$value);
    // Updated to include GST by RodG
    $filter .= 'p.products_price_sorter>=' . ($low - ($low / 11)) . ' and ' . 'p.products_price_sorter<=' . ($high - ($high / 11));
    // $filter .= 'p.products_price_sorter>=' . $low . ' and ' . 'p.products_price_sorter<=' . $high; // original code //
    $prvKey = $key;
    // attributes
    } else {
    if($key != $prvHaving) {
    if($prvHaving != '') {
    $having .= ') and (';
    } else {
    $having .= 'HAVING (';
    }
    } else {
    $having .= ' or ';
    }
    $having .= ' FIND_IN_SET("' . $key . $value . '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))';
    $filter_attr = true;
    $prvHaving = $key;
    }
    }
    }
    //}
    }
    if($filter != '') $filter .= ')';
    if($having != '') $having .= ')';
    if($filter_attr == true && defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK')) $filter .= ' AND p2as.quantity > 0 AND FIND_IN_SET(p2a.products_attributes_id, p2as.stock_attributes)';

    --------------------------------------------------------------------------------------------------------

    OK, so it isn't going to be *exactly* what you want. This was a quick n dirty fix I added to a customers site to account for a 10% GST.
    It shouldn't be hard to replace these hard coded calculations with variables obtained from the Tax tables though.

    Cheers
    RodG
    Thx, I'll go and test it right away.

  6. #6
    Join Date
    Sep 2012
    Posts
    27
    Plugin Contributions
    0

    Default Re: Dynamic Filter - filter does not work on product listing

    Hey guys,

    Thanks for the answers!

    Would it be possible to set the filter so it searches in subcategories too? For example I have binoculars on my site. Category is binoculars and the subcategories are the brands (Zeiss Leupold etc). So if a customer sets a price range filter in the binoculars category, I want him to get the result of all brands in that price range.

    Thanks for the answers in advance!

  7. #7
    Join Date
    Dec 2011
    Location
    Emmen, The Netherlands
    Posts
    85
    Plugin Contributions
    0

    Default Re: Dynamic Filter - filter does not work on product listing

    please dont push a update without fixing the big problems surrounding this plugin when working with large amounts of attributes...

    search through the topic there are a lot of people with this problem!

  8. #8
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: Dynamic Filter - filter does not work on product listing

    Quote Originally Posted by wrickspam View Post
    please dont push a update without fixing the big problems surrounding this plugin when working with large amounts of attributes...

    search through the topic there are a lot of people with this problem!
    I don't think there is a lot that can be done about that. In my opinion, and knowledge, this has to do with the server resources that are available for your site. Large amounts of attribute require large amounts of memory and cpu. But if someone knows a solution for that please help out.

 

 

Similar Threads

  1. Hebrew Support - latest release [Support Thread]
    By eranariel in forum Addon Language Packs
    Replies: 22
    Last Post: 26 Jan 2026, 06:47 AM
  2. Empty Dynamic Filter
    By LadyoftheCave in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 6 Jun 2016, 12:47 PM
  3. v150 Dynamic filter
    By Dinoleix in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 13 Aug 2013, 10:23 AM
  4. v150 Dynamic filter - All pages
    By Okkwebmedia in forum Addon Sideboxes
    Replies: 0
    Last Post: 8 Jul 2013, 08:52 AM
  5. v138a Dynamic Filter
    By SoftCorpse in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 18 Jun 2012, 01:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg