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

southweb’s picture

Issue summary: View changes
southweb’s picture

At the very least it should be:

'weight' => isset($line['weight']) ? $line['weight'] :$item['weight']

southweb’s picture

Version: 7.x-3.0 » 7.x-3.x-dev
TR’s picture

Version: 7.x-3.x-dev » 8.x-4.x-dev
Issue tags: -uc_order.order_pane, -line_items, -line item weight +Novice

Needs a patch, and needs a test. New features go into D8 first...