Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Just a note for ones who need to theme/style cart content rows. To add class odd/even I've added some lines to basic_cart.cart.inc
Function which should be modified is function basic_cart_cart_form():
$delta='odd';
foreach ($cart as $nid => $node) {
$form['cartcontents'][$nid] = array(
'#type' => 'textfield',
'#size' => 1,
'#delta' => $delta,
'#default_value' => $node->basic_cart_quantity,
'#theme' => 'basic_cart_render_cart_element',
);
$delta=(($delta=='odd') ? 'even' : 'odd');
}
After this modification "delta" variable is available which can be used in theme_basic_cart_render_cart_element()
You can get it with
$delta = $variables['form']['#delta'];
Perhaps this can be comitted to module to avoid code modification?