Closed (outdated)
Project:
Basic Cart
Version:
7.x-3.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2014 at 16:01 UTC
Updated:
20 Oct 2025 at 14:10 UTC
Jump to comment: Most recent
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?
Comments
Comment #1
norman.lolThank you everyone for taking the time to report and discuss this issue. 🙇🏻♂️
As the Drupal 7 versions of this module are no longer supported, I’ll be closing this issue. 🔚
Huge thanks and credit to everyone who contributed in any way. ✨