Results 1 to 10 of 809

Hybrid View

  1. #1
    Join Date
    Jan 2012
    Location
    Canada
    Posts
    16
    Plugin Contributions
    0

    Default Re: Dynamic Filter - Narrow Results By In Stock Products

    Heeeeyyyy!
    So I got it installed and working with only a few hiccups. One being the SQL install code not taking into consideration extra columns in my database. I had to add "NULL" to the end of each insert to get it in there and add the "zen_" prefix to the table names. Then using the git hub version of the plugin, it installed correctly and it didn't do that thing where it messes up the CSS in categories with no attributes.
    But now I'm running into a funny bug.
    You can see it yourself on this page: http://www.firstcallautosupply.com/f...ead-cap-screws

    Let's say you try sorting it by bolt width #6. It looks great!
    But try sorting it by bolt width 1/4", and you get no results.
    What's weird is that this seems to only be a problem with the standard bolts, which obviously isn't the bolts fault.
    Playing around with it just now, I think it's having a problem with the quotation mark. That seems to be the only constant when it's not showing results.
    Could someone help me with a fix for this?

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

    Default Re: Dynamic Filter - Narrow Results By In Stock Products

    Quote Originally Posted by Mikey D View Post
    Heeeeyyyy!
    So I got it installed and working with only a few hiccups. One being the SQL install code not taking into consideration extra columns in my database. I had to add "NULL" to the end of each insert to get it in there and add the "zen_" prefix to the table names. Then using the git hub version of the plugin, it installed correctly and it didn't do that thing where it messes up the CSS in categories with no attributes.
    But now I'm running into a funny bug.
    You can see it yourself on this page: http://www.firstcallautosupply.com/f...ead-cap-screws

    Let's say you try sorting it by bolt width #6. It looks great!
    But try sorting it by bolt width 1/4", and you get no results.
    What's weird is that this seems to only be a problem with the standard bolts, which obviously isn't the bolts fault.
    Playing around with it just now, I think it's having a problem with the quotation mark. That seems to be the only constant when it's not showing results.
    Could someone help me with a fix for this?

    Interesting It indeed looks like it has something to do with the quotation marks. I will give it a try tomorrow on my test site.

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

    Default Re: Dynamic Filter - Narrow Results By In Stock Products

    Quote Originally Posted by Design75 View Post
    Interesting It indeed looks like it has something to do with the quotation marks. I will give it a try tomorrow on my test site.
    I tried on my test site this morning and all works as supposed.
    I added an option value to one of the products wit a value of 4" , and when I filter on that value, 2 products(which i gave the attribute) show up.
    After that I added a 1/4" attribute, and that where it get interesting, because all the attribute counts show up as 1, although the filtering still work as it should be. I will need to investigate this further.

  4. #4
    Join Date
    Aug 2006
    Posts
    126
    Plugin Contributions
    0

    Default Re: Dynamic Filter - Narrow Results By In Stock Products

    This is working great except for one peculiarity.

    Since installing it I can filter fine on existing attributes, however if I add new ones, and try to filter, the option is visible and the product count is correct but selecting the option returns no results?

    Any idea why this might be the case? I suppose I could install it again but would rather not in case i've tweaked any files since.

  5. #5
    Join Date
    Aug 2006
    Posts
    126
    Plugin Contributions
    0

    Default Re: Dynamic Filter - Narrow Results By In Stock Products

    And is there a way to prevent read only attributes from showing up?

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

    Default Re: Dynamic Filter - Narrow Results By In Stock Products

    Quote Originally Posted by Justrimless View Post
    And is there a way to prevent read only attributes from showing up?
    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
    PHP Code:
        $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 Code:
        $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:
    PHP Code:
        $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"
    ); 

  7. #7
    Join Date
    Aug 2006
    Posts
    126
    Plugin Contributions
    0

    Default Re: Dynamic Filter - Narrow Results By In Stock Products

    Quote Originally Posted by Design75 View Post
    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.......
    Many thanks.

  8. #8
    Join Date
    Aug 2006
    Posts
    126
    Plugin Contributions
    0

    Default Re: Dynamic Filter - Read only products

    Quote Originally Posted by Design75 View Post
    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
    PHP Code:
        $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 Code:
        $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:
    PHP Code:
        $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.

 

 

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