Post by Profitpro » Fri Jan 13, 2017 10:16 pm

What I need on the invoice when printed is a TOTAL quantity for all products. I have looked and looked for a similar query and have tried to modify the order_invoice.tpl to SUM all of the quantities based on order_id but can't get any query to work. Does anyone have a simple query code to call and sum all quantities by order_id??? Help and direction would be much appreciated!

Newbie

Posts

Joined
Fri Jan 13, 2017 10:04 pm

Post by mohittyagi82 » Sun Jan 15, 2017 6:55 pm

Hi,
Please follow the below instructions :
1. put $totalquantity = 0;
before foreach ($products as $product) {..... on line 1647
2. put $totalquantity = $totalquantity + $product['quantity'];
after $product_data[] = array( ...... array ending..... i.e line 1678
3. put $data['totalquantity'] = $totalquantity;
before $voucher_data = array(); on line 1682
4. Use <?php echo $totalquantity; ?> anywhere on order_invoice.tpl

I hope it will show the desired output !
This code is being tested on opencart 2.2. Please use vqmod/ocmod for changes.

New member

Posts

Joined
Wed Apr 20, 2016 7:02 pm

Post by ppwix » Fri Jul 13, 2018 9:56 pm

Used the above code and it works great! However, when you print more than one invoice in bulk it only chooses the last invoices total quantity and puts it on ALL of them regardless of quantity for the others. I am assuming that it is because of an array somewhere but I don't have any idea where to include. Any ideas so that the quantity is correct on all invoices for bulk printing?

Newbie

Posts

Joined
Wed Nov 29, 2017 3:19 am
Who is online

Users browsing this forum: No registered users and 96 guests