Skip navigation
Help

theme_uc_product_model

6 uc_product.module theme_uc_product_model($model, $teaser = 0, $page = 0)
7 uc_product.theme.inc theme_uc_product_model($variables)

Formats a product's model number.

Parameters

$variables: An associative array containing:

  • model: Product model number, also known as SKU.
  • attributes: (optional) Array of attributes to apply to enclosing DIV.

Return value

string The HTML output.

Related topics

File

ubercart/uc_product/uc_product.theme.inc, line 20
Theme functions for uc_product module.

Code

function theme_uc_product_model($variables) {
  $model = $variables['model'];
  $attributes = $variables['attributes'];
  $attributes['class'][] = "product-info";
  $attributes['class'][] = "model";

  $output = '<div ' . drupal_attributes($attributes) . '>';
  $output .= '<span class="product-info-label">' . t('SKU') . ':</span> ';
  $output .= '<span class="product-info-value">' . check_plain($model) . '</span>';
  $output .= '</div>';

  return $output;
}