Product Page Selling Points list from taxonomy vocabulary

Contrib type: 
Code/CSS Snippet
Status: 
Initial upload
Moderation: 
Awaiting moderation

Downloads

Compatibility: 
Ubercart 2.x

This is my first contribution and I welcome feedback!

I needed a bulleted list of selling points to display below the product page body and above the option selector and Add to Cart sections. The 'selling points' are descriptions of taxonomy terms in the 'Sell Points' vocabulary, in this instance, a vid of '6'.

The manager of the site selects selling points from a list of terms on the product add/edit pages. The lengthier term descriptions are then displayed in an unordered list below the product page body and above the option selector and Add to Cart button.

I copied the theme_uc_product_body() function from sites/all/modules/ubercart/uc_product/uc_product.module to my theme's template.php file. A class of "sellpoints" is added to the <ul> tag for CSS theming.

<?php
function mythemename_uc_product_body($body, $teaser = 0, $page = 0) {
$output = '<div class="product-body">';
$output .= $body;

// Begin modifications
// Print unordered list of taxonomy term descriptions from specified
// vocabulary immediately after the body field.
//
// Enter the vocabulary id that you want to list terms from

$MYVID = '6'; // In my case: <em>Sell Points</em> vocabulary

// load array with all taxonomy items attached to this node
// from the chosen vocabulary

$mytaxon = taxonomy_node_get_terms_by_vocabulary(node_load(arg(1)),$MYVID);
if (
$mytaxon) { //print unordered list of term descriptions if any terms in array
  
$output .= '<ul class="sellpoints">' ;
   foreach (
$mytaxon as $item) {
     
$output .= '<li>' . $item->description . '</li>';
      }
  
$output .= '</ul>' ;
   }

// End modifications
//
//

$output .='</div>';
return
$output;
?>