You are here

function theme_uc_product_minmax in Ubercart Product Minimum & Maximum 6

1 theme call to theme_uc_product_minmax()
uc_product_minmax_nodeapi in ./uc_product_minmax.module
Implementation of hook_nodeapi().

File

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

Code

function theme_uc_product_minmax($min, $multiple, $max, $display_min, $display_multiple, $display_max) {
  if ($multiple > 1 && $display_multiple) {
    $output = '<div class="uc_product_multiple">' . t('This product must be ordered in sets of !qty.', array(
      '!qty' => $multiple,
    )) . '</div>';
  }
  if ($min > 1 && $display_min) {
    $output .= '<div class="uc_product_min">' . t('A minimum order of at least !qty is required.', array(
      '!qty' => $min,
    )) . '</div>';
  }
  if ($max >= 1 && $display_max) {
    $output .= '<div class="uc_product_max">' . t('A maximum order of !qty is allowed.', array(
      '!qty' => $max,
    )) . '</div>';
  }
  return '<div class="product-minmax">' . $output . '</div>';
}