1 reply [Last post]
green's picture
Offline
Joined: 08/07/2007
Juice: 14
Was this information Helpful?

Hi ÜberDudes Smiling

first let me say, thank you so much for this great übercart project! It works perfectly for me.
Now i want to show the manufacturer description (which i can change here: admin/content/taxonomy/edit/term/14) on the manufacturers page (/manufacturer) and sub page (/manufacturer/14).

<?php
/**
* Formats the manufacturer page.
*
* @param $manufacturer
*   A manufacturer object.
* @ingroup themeable

*/

function theme_uc_manufacturer($manufacturer, $page = false){
 
$output = '';
  if (
$manufacturer){
   
$output  = '<div class="manufacturer">';
    if (!
$page){
     
$output .= l($manufacturer->name, 'manufacturer/'. $manufacturer->tid) .'<br />';
    }
    if (
$manufacturer->logo){
     
$output .= l(theme('imagecache', 'manufacturer', $manufacturer->logo), $manufacturer->url, array('target' => '_blank'), null, null, false, true);
     
//$output .= l('<img src="'. base_path() . $manufacturer->logo .'" alt="'. $manufacturer->name .' Logo" />', $manufacturer->url, array('target' => '_blank'), null, null, false, true);
   
}
   
//$output .= l(t('Edit'), 'manufacturer/'. $manufacturer->tid .'/edit') .'<br />';

   

$output .= "<ul>\n";
    if (!empty(
$manufacturer->url)){
     
$output .= "  <li>". l($manufacturer->url, $manufacturer->url, array('target' => '_blank')) ."</li>\n";
    }
    if (!empty(
$manufacturer->phone_no)){
     
$output .= "  <li>Phone: ". $manufacturer->phone_no ."</li>\n";
    }
    if (!empty(
$manufacturer->fax_no)){
     
$output .= "  <li>Fax: ". $manufacturer->fax_no ."</li>\n";
    }
   
$output .= "  </ul>\n";
   
$output .= "</div>\n";
  }
  return
$output;
}
?>

I put

<?php
$output
.= $manufacturer->description;
?>

there:

<?php
   
if ($manufacturer->logo){
     
$output .= l(theme('imagecache', 'manufacturer', $manufacturer->logo), $manufacturer->url, array('target' => '_blank'), null, null, false, true);
     
//$output .= l('<img src="'. base_path() . $manufacturer->logo .'" alt="'. $manufacturer->name .' Logo" />', $manufacturer->url, array('target' => '_blank'), null, null, false, true);
   
}
   
//$output .= l(t('Edit'), 'manufacturer/'. $manufacturer->tid .'/edit') .'<br />';

     

$output .= $manufacturer->description;
?>

But the description is only shown on the sub page? I'm wondering why only there?

Thanks in advance for your help,
Denny

uc: 5.x-1.0-alpha7e

sea_lmm's picture
Offline
Joined: 01/17/2008
Juice: 2
Well this is quite an old

Well this is quite an old post but in case someone else stumbles here as I did looking for the same kind of hint, the approach that worked for me is:

use this:
taxonomy_get_term($manufacturer->tid)->description

instead of:
$manufacturer->description

in order to output the manufacturer's description.