Re: Re: Re: Re: Re: Re: Customer who bought this also bought...

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Re: Re: Re: Re: Re: Customer who bought this also bought...

Honestly, I think the way for a feature like this to be scalable is for it to just go into a contrib module and keep a mapping table. This module can use hook_order() on the 'submit' $op and insert a row in the table for every combination of products. The table should have a product node ID and a related node ID, and you should enter a single row for every possible combination of product nodes. Then to display products, you simply query this table based on the currently viewed node, order it randomly, and limit the results.