Page 7 of 81 FirstFirst ... 567891757 ... LastLast
Results 61 to 70 of 808
  1. #61

    Default Re: Dynamic Filter v1.0 - 'AND' filtering, rather than 'OR'

    BTW, is there a semi-simple way to have number of items per attribute in brackets after the attribute in the filter listing, as per my other thread? Just asking....

    If you look in the ....templates/sideboxes/tpl_dynamic_filter.php file, in the section that generates the attribute filters, I think I put a column called quantity in the select statement. You can use that to display a count but it will only work for attributes which is why it never went live. Categories, brands, price range won't show a count.
    That's as far as I got with it I'm afraid!

  2. #62

    Default Re: Dynamic Filter 1.0 not working for Options

    kamelion,
    I've been working with Jimproz on this and have tracked it down to what may be a MySQL bug.
    There's a query that is generated with an 'order by' clause, which when executed returns an incorrect number of rows. If the order by clause is removed, the query works correctly. I can't see a reason for it except a bug in the version of MySQL he's running, although I'm no SQL expert!
    Do you have another server which is running a different version of MySQL you can try this on?

  3. #63
    Join Date
    Jul 2010
    Posts
    30
    Plugin Contributions
    0

    Default Re: Dynamic Filter v1.0 - 'AND' filtering, rather than 'OR'

    So you did....another thing I didn't notice. I tried using 'p2as.quantity' and got nothing...but 'quantity' works like a dream. The great thing is....I'm only using attributes, so it's precisely what I'm looking for! I've now added the code so after the attribute name I have the quantity in brackets. Well, braces, actually - they look pretty cool.

    Thanks again for a great mod. Still got misaligned sideboxes underneath, though - have to do some more digging when I get chance.

    Cheers!
    Gavin

  4. #64
    Join Date
    Dec 2011
    Posts
    19
    Plugin Contributions
    0

    Default Re: Dynamic Filter v1.0

    There is a line in tpl_dynamic_filter.php that I believe is intended to give this functionality, but I could not get it to work myself, maybe you have more luck and can share your results?

    PHP Code:
            // Below line counts up all quantities of each item. e.g. if a glove is available in Small and Medium, quantity = 2.
            //$attributes = $db->Execute("SELECT po.products_options_name, pov.products_options_values_name, count( p2as.quantity ) as quantity" . 

  5. #65
    Join Date
    Jul 2010
    Posts
    30
    Plugin Contributions
    0

    Default Re: Dynamic Filter v1.0

    Hi there,

    Glad to share...code required is around l.324 and is as follows (extra bit is in BOLD);

    case 'Checkbox':
    $filters .= '<li class="dFilterLink">' . zen_draw_checkbox_field($group . '[]', $attributes->fields['products_options_values_name'], (isset($_GET[$group]) && in_array($attributes->fields['products_options_values_name'],$_GET[$group]) ? true : false), ($linkClass == 'disabled' ? 'disabled="disabled"' : '') . ($onClick != '' && FILTER_STYLE == 'Checkbox - Single' ? ' onclick="' . $onClick . '"' : '')) . htmlspecialchars(html_entity_decode($attributes->fields['products_options_values_name'], ENT_QUOTES)) .' {' . htmlspecialchars(html_entity_decode($attributes->fields['quantity'], ENT_QUOTES)). '}' . '</li>';

  6. #66
    Join Date
    Dec 2011
    Posts
    19
    Plugin Contributions
    0

    Default Re: Dynamic Filter v1.0

    Works great, thanks!

  7. #67
    Join Date
    Dec 2009
    Posts
    206
    Plugin Contributions
    2

    Default Re: Dynamic Filter 1.0 not working for Options

    I think I do - my test site (burningbutterfly.com) is on 5.0 while my live site is on 5.5. I don't know if that will be enough of a difference in version to make a difference but it's worth a shot. As soon as my test server comes back up, I'll transfer the test files to my live site's server and see if there's any difference.

    What file is the incorrect orderby clause in? I'm no MySQL expert by any means but if I stare at a problem long enough, sometimes I can figure out what the problem is :)

    Thanks again! This mod is awesome and makes such a difference in making a site look more professional.

  8. #68
    Join Date
    Dec 2009
    Posts
    206
    Plugin Contributions
    2

    Default Re: Dynamic Filter 1.0 not working for Options

    Unfortunately it didn't work on MySQL 5.5. I'll keep digging through the files for the order by clause and see what I can come up with.

  9. #69

    Default Re: Dynamic Filter 1.0 not working for Options

    Thanks for trying.
    The only other thing I've spotted that your site and jimproz have in common is the lack of the sort box....the one that let's you sort by price, date added, etc.
    I can't see why that would make a difference...I'm kind of grabbing at straws now!

    The SQL that is responsible for generating the product listing is in includes/modules/product_listing.php.
    Around line 75 $listing = $db->Execute($listing_split->sql_query);

    $listing_split->sql_query is generated by the supplied modified file includes/classes split_page_results.php

    Your problem may not actually be the same as jimproz's because when he gets no products displayed in the list, he still gets the 'Displaying 1 to 2 (of 2 products)' message, just no products displayed.
    Your site doesn't show that message.

  10. #70
    Join Date
    Dec 2009
    Posts
    206
    Plugin Contributions
    2

    Default Re: Dynamic Filter 1.0 not working for Options

    Quote Originally Posted by damiantaylor View Post
    The only other thing I've spotted that your site and jimproz have in common is the lack of the sort box....the one that let's you sort by price, date added, etc.
    I can't see why that would make a difference...I'm kind of grabbing at straws now!
    I'll turn on the sort box and see if that makes a difference because sometimes grabbing at straws works :)

    I added an admin switch to 'includes/templates/custom/sideboxes/tpl_dynamic_filter.php' so that I can turn off the manufacturer filter, price filter and category filter in the filter sidebox as well as a switch for the price filter so that it will only show up only if there is more than one option. I tried replacing that file with the default one but it didn't make a difference.

    Quote Originally Posted by damiantaylor View Post
    The SQL that is responsible for generating the product listing is in includes/modules/product_listing.php.
    Around line 75 $listing = $db->Execute($listing_split->sql_query);

    $listing_split->sql_query is generated by the supplied modified file includes/classes split_page_results.php
    Thanks!

    Quote Originally Posted by damiantaylor View Post
    Your problem may not actually be the same as jimproz's because when he gets no products displayed in the list, he still gets the 'Displaying 1 to 2 (of 2 products)' message, just no products displayed.
    Your site doesn't show that message.
    I actually have it coded so that it doesn't show that message unless there is more than one page of products to display. I changed it back to the default code, but it didn't make a difference.

    The only products I have the problem on are ones that have more than one attribute that is required to add it to the cart - does jimproz have the same issue? Or is it not sorting for any of their products?
    Last edited by kamelion0927; 24 May 2012 at 04:23 PM.

 

 
Page 7 of 81 FirstFirst ... 567891757 ... LastLast

Similar Threads

  1. Hebrew Support - latest release [Support Thread]
    By eranariel in forum Addon Language Packs
    Replies: 19
    Last Post: 23 Jan 2023, 08:04 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

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR