You are here

function theme_uc_attribute_add_to_cart in Ubercart 6.2

Same name and namespace in other branches
  1. 7.3 uc_attribute/uc_attribute.theme.inc \theme_uc_attribute_add_to_cart()

Displays the attribute selection form elements.

See also

_uc_attribute_alter_form()

File

uc_attribute/uc_attribute.module, line 1430

Code

function theme_uc_attribute_add_to_cart($form) {
  $output = '<div class="attributes">';
  $stripes = array(
    'even' => 'odd',
    'odd' => 'even',
  );
  $parity = 'even';
  foreach (element_children($form) as $aid) {
    $parity = $stripes[$parity];
    $classes = array(
      'attribute',
      'attribute-' . $aid,
      $parity,
    );
    $output .= '<div class="' . implode(' ', $classes) . '">';
    $output .= drupal_render($form[$aid]);
    $output .= '</div>';
  }
  $output .= drupal_render($form) . '</div>';
  return $output;
}