![]() |
Show total quantity on order_data.tpl or the invoice
Hi,
I'm needing to display the total number of items in an order on the invoice (or on order_data.tpl.) I've searched the forum but could only find a very old, very complicated way to do this and I was hoping there was going to be a better way. Does anyone know of one? |
Re: Show total quantity on order_data.tpl or the invoice
{$products|@count} will give you total unique items, if you need total including quantity for each item you have to do some math in the foreach loop in order_data.tpl with $product.amount
|
Re: Show total quantity on order_data.tpl or the invoice
Thanks for the quick reply! So far I've got it to manually add up the number of items in the order...but I can't get my head around factoring in the quantities of each:
{foreach from=$products item=product name=num} {$smarty.num.index} {math equation="value+1" value=$smarty.foreach.num.index} It outputs a list of 1 2 3 4 5 6 7 8 9 etc. |
Re: Show total quantity on order_data.tpl or the invoice
Untested suggestion:
Code:
{assign var=numProducts value=0} |
Re: Show total quantity on order_data.tpl or the invoice
BRILL-LIANT. Worked absolutely perfectly. Thank you so much.
|
All times are GMT -8. The time now is 04:44 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.