Re: Customer who bought this also bought...

Joined: 08/07/2007
Juice: 6673

Others have asked about it before, but all that got lost in the server crash. No one's announced that they're working on anything like that. I started a marketing module to hold this kind of functionality, but I really only got as far as this query:

<?php
  $result
= db_query("SELECT that.nid, COUNT(that.nid) AS frequency FROM {uc_order_products} AS this LEFT JOIN uc_order_products AS that ON this.order_id = that.order_id LEFT JOIN uc_orders AS orders ON that.order_id = orders.order_id WHERE this.nid = %d AND that.nid != %d GROUP BY that.nid ORDER BY frequency DESC, orders.created DESC LIMIT %d", $nid, $nid, variable_get('uc_marketing_display_limit', 6));
?>

I don't see myself going back to it unless I get really burnt out on other problems. Anybody is welcome to take this and run with it.