Suggested product?

Posts: 45
Joined: 09/03/2007

I may have missed this, but is there a way to suggest a product, a la Amazon: "People who have purchased this product have also purchased XX" or "A great addition to this product is XX"

Thanks,
Brewski

Posts: 151
Joined: 08/07/2007
AdministratorNot Kulvik

Look on this post under Cross Selling Products for how one person did it:
http://www.ubercart.org/forum/live_sites/940/magmamags_magazine_subscrip...
also there is a Drupal Related nodes module which could work: http://drupal.org/project/related_block
Andy

Posts: 329
Joined: 08/28/2007
Early adopter... addicted to alphas.Not KulvikTheminator

I read aswalla's post earlier on. He's managed to do some pretty nifty things with his site.

Didn't know about the related nodes block, thanks for pointing it out to us Andy.

Posts: 13
Joined: 12/12/2007

Hi,
I have designed a site for selling toners. I was trying to have all toners that belong to the same printer to be listed in the page of one of them. For example take a look at:

http://www.iberotoner.com/toner-compatible/toner-hp/m-c9703a.html

The block "Prod. relacionados" list all other toners for any of the printers that the current toner is used.

Code is not complicated:

<?php
if (arg(0) == 'node' && is_numeric(arg(1)) && is_null(arg(2))) {
 
$nid = (int)arg(1); // GET CURRENT NODE ID
 
$terms = taxonomy_node_get_terms_by_vocabulary($nid, "6"); // GET TERMS FOR TAGGING VOCAB (6)
if (!$terms) {return;} // NO TERMS THEN EXIT
 
foreach($terms as $term){
   
$sql = "SELECT n.title, n.nid FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid = $term->tid AND n.nid != $nid LIMIT 5"
   
$result = db_query(db_rewrite_sql($sql));
    if (
db_num_rows($result)) {
      while (
$anode = db_fetch_object($result)) {
       
$node_list[$anode->nid]=l($anode->title, "node/$anode->nid");
       
// CREATE ARRAY WITH NODES BECAUSE FOR EACH TERM NODES COULD BE LISTED AGAIN, THIS COULD BE SIMPLIFIED BUT THIS WAY IT WORKS
     

    }
  }
if (!
$node_list) {return;}
 
$output = "<table width='100%' border='0' cellpadding='0' cellspacing='0'>";
foreach(
$node_list as $key => $value)
{
   
$output .=  "<tr><td>".$value."</td></tr>";
}
 
$output .= "</table>";
  return
$output;
}
?>