Jump to content

Adding a "total items" in Backend: Order details page


nikmagnus

Recommended Posts

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

post-145202-0-75757500-1437188351_thumb.png

Edited by nikmagnus (see edit history)
Link to comment
Share on other sites

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...