nikmagnus Posted July 18, 2015 Share Posted July 18, 2015 (edited) Hi everyone. Im wanting to add to this part of the orders detail page: (PS 1.5.6.2) Date 06/18/2015 17:29:56 | Messages1 | New Customer Messages1 | Products 3 | Total $57.00 I'd like to list the total number of items in the order. Currently the "Products 3" lists the number of individual products, but this is the same as the number of items only if the quantity is 1 each. So in this case: Product A 3 Product B 4 Product C 1 Products is 3 But number of items is 8. I'd like to figure out how to add in "Total items: 8" along side the "| Products 3 |" I've looked into view.tpl (admin/themes/default/template/controllers/orders/helpers/view.view.tpl) And can see the code: <dl> <dt>{l s='Products:'}</dt> <dd id="product_number">{sizeof($products)}</dd> |</dl> <dl> <dt>{l s='Total'}</dt> <dd class="total_paid">{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}</dd> </dl> it seems that sizeof($products) count the individual products. What would be the code to calculate the sum of the quantity of each $product Im thinking it would be something like {array_sum($products->quantity)} Any suggestions? Thanks! Nik Edited July 18, 2015 by nikmagnus (see edit history) Link to comment Share on other sites More sharing options...
nikmagnus Posted July 24, 2015 Author Share Posted July 24, 2015 Is anyone able to help me with this? Link to comment Share on other sites More sharing options...
LuisMY Posted March 27, 2017 Share Posted March 27, 2017 Hi, I´m looking for the same thing, did you find a way to do it despite the lack of help in the forum? Thanks Link to comment Share on other sites More sharing options...
musicmaster Posted March 31, 2017 Share Posted March 31, 2017 Variables like $products and $orders are complex data constructions. You can see their contents with {$var|print_r} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now