g_p Posted August 12, 2005 Posted August 12, 2005 Hi, I am using the Advanced Attribute Search contribution (http://www.oscommerce.com/community/contributions,2337/) which adds drop down boxes to the advanced search page and pulls in the search options from the product attributes set up in the system. I was wondering if anyone knows how to set this up so it displays results using the AND operator, rather than OR? For example I have 3 attribute sets: type, size and colour. If I select type->1 and colour->blue on the search page, the results returned are all type 1 products regardless of their colour, together with all blue products regardless of their type. I would like this to return only products that have both attributes (ie. only type 1 products that are blue) but I can't work it out... Any help would be greatly appreciated. Thanks. Quote
falter Posted September 4, 2007 Posted September 4, 2007 I'm having the exact same problem with that contribution. Like the original poster I have three attributes, but instead of reporting back products that match ALL three selected attributes, it lists all the products that have EITHER attribute a, OR b, OR c. I'm not 100% sure, but I think this is the relevant part of the MySQL select from .... where...query: pa.products_id = p.products_id and pa.options_values_id in (33,71,91) The PHP code is posted in this thread: http://www.oscommerce.com/forums/index.php?showtopic=165459 Any help/suggestions would be greatly appreciated. Thanks a lot!!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.