I've been hunting for a solution to this but haven't come up with an answer.

I have a site with approximately 100 auto parts, each of which fits numerous vehicles and there is overlap in which part will fit a given vehicle. Hypothetical example:

1999-2009 Mfgr1, ModelA
2002-2005 Mfgr2, ModelB
1963-1969 Mfgr3, ModelC

The parts below are compatible with the above vehicles:

Part1
Part2
Part3

But, Part2 also fits 10 other vehicles and Part3 fits 20. A many-to-many relationship.

I'm looking to provide a search function where a visitor may select the Year, Make, and model of their vehicle(s), preferably in drop-downs, and be presented with a list of the parts which will fit their vehicle.

Any thought on how to do this and also minimize the effort to establish the relationships and achieve the search function?

Additionally, not to confuse matters, but the primary difference between the parts is bracketry. So,

Part1 includes Bracket1, Bracket2, Bracket3
Part2 includes Bracket1, Bracket3, Bracket5
Part3 includes Bracket1, Bracket5, Bracket9

I was thinking that it might be easier to create CCK fields which would indicate the brackets included with the part and make associations based upon the Bracket rather than the part. The reason for this is that there are fewer brackets than parts and this would reduce the amount of work to make the vehicle associations.

Thanks for your input.

Comments

WorldFallz’s picture

if you use taxonomy for the categorization of parts, you could then use the http://drupal.org/project/hierarchical_select module for an excellent selection UI.

TrinitySEM’s picture

Thanks worldFallz. I think that hierarchical_select will work for the product selection portion of the issue.

The other issue is assigning multiple vehicles to a given part. Typically a node permits you to select one relationship. So I could select one range of years and the make and model. But I cannot select other vehicles with different years.

For example:

1963-67 Make1, ModelA
1965-68 Make2, ModelB

I'm not certain how I would assign a taxonomy to a node where multiple assignments are required. I could multiple select 1963-1968, Make1, Make2, ModelA, and Model B but if the visitor selected 1968 they would be able to also select Make1, ModelB even though the part would not fit this vehicle. I'm curious about how I would be able to define several relationships on one node.

WorldFallz’s picture

Maybe I don't completely understand the issue but there's an option to make a vocabulary multi-select. You should be able to add as many year/make/model combinations as you want.

TrinitySEM’s picture

Hmmm. I'll give it another look. I thought it provided the selection mechanism for the visitor but didn't assign the taxonomy relationship to the node. If it does that then I might be all set. I'll try it.

Thanks again for your help.

TrinitySEM’s picture

Here's what I've found so far:

I see how to assign various HS tags to a single node. So, for example, I can create a tag called (please ignore inaccuracies in models/years):

2003 > Chevy > Corvette > ZR1

The problem is that the part will also fit the 2002, 2001, etc. This requires a huge amount of input because I would need to add:

2003 > Chevy > Corvette > ZR1
2002 > Chevy > Corvette > ZR1
2001 > Chevy > Corvette > ZR1
etc. for every make, model, year and sub model.

I haven't been able to determine a method of making multiple selections on year while also being able to create multiple tags (as in the above example). That would reduce the amount of labor by a significant factor.

I've attempted to create two vocabularies (one for year, another for Make which includes Model and Sub Model). This doesn't seem to work because a disconnect between year and the Make vocabularies means that incorrect nodes will be available.

So, for example:

If I intend to create tags for:

2001-2003 Chevy Corvette ZR1
2002-2006 Chevy Malibu

Then 2004-2006 Corvettes will show as being compatible with that node when in fact, those years/models may not be.

Anyone have a suggestion or workaround?

Thanks!

criznach’s picture

How about if you create a new content type that links a particular vehicle year/make/model to a part?

This content type has a node reference to the part that you can use in views relationships. Then use a cck date field to represent multiple years. Use taxonomy for make/model. Use views exposed arguments and relationships to filter your matching parts. I haven't thought it completely through, but it seems like a more flexible approach than packing multiple many-to-many relationships into the child nodes. Then you can have multiple date ranges, multiple make/models, multiple bracket combinations. The downside is your views and search will be much more complicated.

In a traditional, relation database, you'd probably have an intermediate table linking year ranges, make/model and brackets to a part. I'd try to replicate that structure in Drupal.

TrinitySEM’s picture

This is creative. Thank you for your input.

"How about if you create a new content type that links a particular vehicle year/make/model to a part?"

Hmm. Not following you on this. Are you suggesting that I create a content type for each make/model/sub model combination and then using a CCK field to define the dates? If so, I did not detect a facility within CCK for selecting a year range. Also, with hundreds of model combination this approach would require a huge amount of data entry and a lot of duplicate content no?

I like the hierarchical select concept because I am able to set make, model, submodel. The problem is year. I can't select multiple years for a given model set though this seems to be true for every approach I've attempted. Also, the search facility becomes very cluttered. I like your idea of using views and exposing arguments but again, I'm having difficulty associating years with the "make" set.

criznach’s picture

Sorry I missed your questions. I hadn't looked back at my posts for a while.

Maybe just two numeric fields using the option widget for the dates. Or - although I've never tried this - I thought you could specify a granularity of "year" on a date field. Maybe not...

And if I recall (it's been a while), I'm not suggesting this as a content type for browsing - just for linking parts to their attributes and querying against with views relationships. I think your problem implies lots of data and data entry (or bulk import) no matter how you solve it.

Chris.

bfr’s picture

Did you come up with a solution? I'm trying to make something similar.

TrinitySEM’s picture

@bfr - I think that @criznach is on the right track but I haven't had the bandwidth to do some testing of his idea. If I come up with a solution I'll report back.

@criznach - thanks for the additional input. I'll give it a try.

joshribakoff’s picture

I have an existing solution, www.vehiclefits.com

For a small fee I could port this to a Drupal plugin

summit’s picture

Interested in this also, subscribing. Greetings Martijn

mrbeau’s picture

Trinity, I'm curious as to how you solved this in the end, or are you still working on it? :)

TrinitySEM’s picture

It's a personal project so I haven't had the time pressure to get it done. Since my first post though we've added 10 developers to our team so I do plan on jumping on it soon. If you're interesting in participating, please let me know.

Ignigena’s picture

Ran across this thread as I was looking for a Vehicle Y/M/M module for Drupal. As I couldn't find a good solution already made, I decided to roll my own which is now in the review queue to become a full module. This module was made for Drupal 7, so sorry to anyone who really needs a D6 version (one could probably be backported with enough demand)

If interested, test it out and provide feedback here:
http://drupal.org/node/1806866