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!
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.
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.
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?
Who is online
Users browsing this forum: No registered users and 96 guests