WhirlyGirl Posted May 29, 2006 Posted May 29, 2006 Hi, I am looking for a module or hack to display the total number of items ordered (units) above the sub-total on the invoice. I presume the best way to do this would be as an order total module, however I can't find one in the contributions. Can anybody help, or do you know of a modules that will achieve this? Thanks in advance, WG Quote
Guest Posted May 29, 2006 Posted May 29, 2006 Hi, I am looking for a module or hack to display the total number of items ordered (units) above the sub-total on the invoice. I presume the best way to do this would be as an order total module, however I can't find one in the contributions. Can anybody help, or do you know of a modules that will achieve this? Thanks in advance, WG I thought that this was the default? Quote
WhirlyGirl Posted May 29, 2006 Author Posted May 29, 2006 Sorry, I should have explained this more clearly. It shows total units for each item with no problems, but I would like it to show the total units in the whole order, for example, if you purchase: 4 X Chairs 1 X Table 8 X Place Mats I would like it to show in the list of order totals as: Total Units: 13 Sub-Total: ?price VAT: ?VAT Freight Charge: ?shipping Total: ?total If this is a built in feature I must be missing it, becuase I have spent days searching for a way to do it with no luck! :( Look forward to your replies, WG Quote
Guest Posted June 3, 2006 Posted June 3, 2006 use the low order fee class it's in the order totals modules. Just rename the strings to "total units" and then retrieve the number of items from the $order globals $order->products array. Add the qty field of the array to setup the total units. $total_units = 0; for( $i=0, $j=count($order->products); $i<$j; $i++) { $total_units += $order->products[$i]['qty']; } Then the $total_units will be the 'value' of the loworderfee module. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.