You are here

function theme_display_minmax in Ubercart Product Minimum & Maximum 7

Custom theme function to allow themes to override or customize display.

1 theme call to theme_display_minmax()
uc_product_minmax_node_view in ./uc_product_minmax.module
Implementation of hook_node_view().

File

./uc_product_minmax.module, line 392
This module adds a product feature for you to enter a minimum, maximum and order in mulitples quantity of the product that must be in the cart for it to be checked out.

Code

function theme_display_minmax($variables) {
  $output = '<div class="product-minmax">';
  if ($variables['multiple'] > 1 && $variables['display_multiple']) {
    $output .= '<div class="uc_product_minmax_multiple">' . t('Must be ordered in sets of %qty.', array(
      '%qty' => $variables['multiple'],
    )) . '</div>';
  }
  if ($variables['min'] > 1 && $variables['display_min']) {
    $output .= '<div class="uc_product_minmax_min">' . t('A minimum order of at least %qty is required.', array(
      '%qty' => $variables['min'],
    )) . '</div>';
  }
  if ($variables['max'] >= 1 && $variables['display_max']) {
    $output .= '<div class="uc_product_minmax_max">' . t('A maximum order of %qty is allowed.', array(
      '%qty' => $variables['max'],
    )) . '</div>';
  }
  $output .= '</div>';
  return $output;
}