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.
Line item weights are defined in hook_uc_line_item
These are respected in: uc_order_pane_line_items whereas title and amount can be altered in their respective call backs.
Our view is that weights should also be able to be overridden in their respective call backs and or line item hooks.
Below is our code suggestion and the change we have applied locally:
--- sites/all/modules/ubercart/uc_order/uc_order.order_pane.inc (revision 56)
+++ sites/all/modules/ubercart/uc_order/uc_order.order_pane.inc (working copy)
@@ -637,7 +637,7 @@
$line_items[] = array(
'title' => $line['title'],
'amount' => $line['amount'],
- 'weight' => $item['weight']
+ 'weight' => $line['weight'] /* Modified *AM to support formatted line items */
);
}
}
Comments
Comment #1
southweb CreditAttribution: southweb commentedComment #2
southweb CreditAttribution: southweb commentedAt the very least it should be:
'weight' => isset($line['weight']) ? $line['weight'] :$item['weight']
Comment #3
southweb CreditAttribution: southweb commentedComment #4
TR CreditAttribution: TR commentedNeeds a patch, and needs a test. New features go into D8 first...