Re: Dynamic Filter 1.0 not working for Options
Quote:
Originally Posted by
damiantaylor
We need to see if the number of rows returned by $listing_split is greater than zero (my guess is it isn't) so try adding this 'die' line....
Code:
die('I see ' . $listing_split->number_of_rows);
if ($listing_split->number_of_rows > 0) {
$rows = 0;
$listing = $db->Execute($listing_split->sql_query);
$extra_row = 0;
while (!$listing->EOF) {
$rows++;
if ((($rows-$extra_row)/2) == floor(($rows-$extra_row)/2)) {
$list_box_contents[$rows] = array('params' => 'class="productListing-even"');
} else {
$list_box_contents[$rows] = array('params' => 'class="productListing-odd"');
}
If you see 'I see 0' then $listing_split is zero which is why you're getting no products listed.
We'd then need to look at file 'includes/classes/split_page_results.php' to see why $listing_split has returned no rows.
Did you upload the 'split_page_results.php' file supplied in the distribution or did you add the changes manually?
Nope, that didn't display 'I see 0' so I think that's not where the problem is (split_page_results.php) So strange it will filter properly some values, while others it will partial (like 6 out of 7 items filtered) or some none at all. I'm so stumped on this. I uploaded the 'split_page_results.php' file in the supplied distribution. Thanks again Damian for your help getting this working for me. I really do appreciate it.
Re: Dynamic Filter 1.0 not working for Options
I'm having the same issue as jimproz.
I played around with the attributes on the products that were showing nothing when I tried to filter them on the advanced search page and it seems like if the product has more than one attribute that needs to be selected to add it to the cart, it won't filter properly.
If you go to burningbutterfly.com and search for milk, there are 7 product results. If you select "Unscented/Fragrance Free" on the Dynamic Filter, it will filter properly as those products have no selectable attributes (only read-only). But if you try to filter by "Scented", "Essential Oil/Aromatherapy", or by either of the Product Type options, you get either a blank page or are sent to the "There are no items that match your search criteria" page.
I removed one of the selectable attribute groups from a product that can be filtered by "Scented" so that it only had one group of selectable attributes and the filter worked for that product but when I added the second attribute group back in, it didn't work anymore.
I hope that makes sense - I've been working on this for a while and am starting to get cross-eyed.
Thanks for your help!
Dynamic Filter v1.0 - 'AND' filtering, rather than 'OR'
Hi,
It seems to me that the current filtering works within one attribute as an OR filter; eg. for an ETHICS filter it may search for a product that is Fairly Traded OR Organic OR Vegan. It would be very useful to have the option to search for products that are Fairly Traded AND Organic AND Vegan instead.
I see some cases where an OR is the only way to filter, like for instance Sizing (Child OR Adult), or Pricing (one price band OR another), but in my cases I'd really like to search for products which have one or more attribute option values.
There is another attribute I use; Music Style. Here, a product could have the attribute values Indian AND Dance, for instance - or Children AND World AND Christmas.
Is this possible?
Regards,
Gavin
Re: Dynamic Filter v1.0 - 'AND' filtering, rather than 'OR'
I recently discovered this mod, I think it helps take Zencart up to Magento level.
Don't yet have it live anywhere and it's not on a current test site of mine. But do not all attributes show in the filter? That is, everything you mention, will they not appear?
Anyway, since I also recently discovered (after 6 years with zencart) that we can make Read Only attributes, this filter has great potential for us, as we can filter by dress type (long, short, halter, ballgown etc.) without them being selectable attributes.
sph
prommart com
zencart 1.5 testing site:
http://www.prom-mart.com/demo-2/
Re: Dynamic Filter v1.0 - 'AND' filtering, rather than 'OR'
I agree, it's a great mod - but I don't think I've explained myself clearly enough.
Let's say I have an attribute 'ETHICS', with attribute values FAIRTRADE Mark, Organic, Vegan, Vegetarian, Eco-Friendly. Let's then say I select 'FAIRTRADE Mark' AND 'Vegan'. When the filter is run, this will return products that have the value 'FAIRTRADE Mark' AND the products that have the value 'Vegan'. So far so good - however, what I actually want is for the filter to return ONLY the products which have BOTH the values 'FAIRTRADE Mark' AND 'Vegan'; true AND logic.
Put more simply; the filter returns any product which satisfies condition 'A' OR condition 'B'. It does *not* return the products which satisfy conditions 'A' AND 'B'.
So - the question remains - I assume the answer is yes - is there any way to have the filter function as an AND filter, rather than an OR? I'm afraid my SQL is pretty much less than basic, so can't figure it out for myself, sorry.
Re: Dynamic Filter v1.0 - 'AND' filtering, rather than 'OR'
I tested this filter on a test demo site just enough to see it's potential, then deleted my test site when it blew-up for other reasons. Haven't yet gotten back to this filter on my new demo test sites.
I am not yet familiar enough with this filter to know.
sph
prommart com
Re: Dynamic Filter v1.0 - 'AND' filtering, rather than 'OR'
No worries SPH - just hoping Damian can help me out when he gets back from wherever he's been :-) BTW, I've got a problem with the left cols misaligning as well - even copying the code over hasn't helped for me...
Gavin
Re: Dynamic Filter v1.0 - 'AND' filtering, rather than 'OR'
Gavin,
Off the top of my head, if you look in the new files folder includes/modules/YOUR_TEMPLATE/dynamic_filter.php you'll see where the ORs are generated. Change these to ANDs and you should be good to go.
This will mean all the filters all be ANDed together though, no way to say you want some ANDing and others ORing I'm afraid
Re: Dynamic Filter v1.0 - 'AND' filtering, rather than 'OR'
Hi Damian - Ha! Why didn't I think of that? A search for 'OR'. OK, I'll take a look at that when I have a few mins - busy re-coding something else at the moment. Pretty addictive, this Zen Cart-ery. Great feeling when I get something right and things move about the way I'd like them :-)
I realise it's going to be either 'AND' or 'OR', unless a fancy switch was put in with another bit of code to display (maybe for the future...), but in my case, 'AND' is what is most useful for my purposes. I'll let you know how I get on.
Thanks for your help,
Gavin
Re: Dynamic Filter v1.0 - 'AND' filtering, rather than 'OR'
Hi Damian,
That works great - now I can look for foods that are Fairtrade AND Organic AND Vegan (or whatever). For some reason, I didn't actually have that file locally - only on my server - which is how I missed it. Must. Remember. Keep. Files. Synced!
Thanks a lot for your help. (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....).
Cheers,
Gavin