You are here

function theme_uc_product_weight in Ubercart 7.3

Same name and namespace in other branches
  1. 5 uc_product/uc_product.module \theme_uc_product_weight()
  2. 6.2 uc_product/uc_product.module \theme_uc_product_weight()

Formats a product's weight.

Parameters

array $variables: An associative array containing:

  • amount: A numerical weight value.
  • units: String abbreviation representing the units of measure.
  • attributes: (optional) Array of attributes to apply to enclosing DIV.

See also

uc_weight_format()

2 theme calls to theme_uc_product_weight()
uc_product_kit_view in uc_product_kit/uc_product_kit.module
Implements hook_view().
uc_product_view in uc_product/uc_product.module
Implements hook_view().

File

uc_product/uc_product.theme.inc, line 107
Theme functions for uc_product module.

Code

function theme_uc_product_weight($variables) {
  $amount = $variables['amount'];
  $units = $variables['units'];
  $attributes = $variables['attributes'];
  $attributes['class'][] = "product-info";
  $attributes['class'][] = "weight";
  $output = '';
  if ($amount) {
    $output = '<div ' . drupal_attributes($attributes) . '>';
    $output .= '<span class="product-info-label">' . t('Weight') . ':</span> ';
    $output .= '<span class="product-info-value">' . uc_weight_format($amount, $units) . '</span>';
    $output .= '</div>';
  }
  return $output;
}