To get the total number of rows in the products array, try {$products|@count}
To know what the current index of the array is use {$smarty.foreach.myproducts.index} -to use .index or .iteration you need to name your foreach loop.
Example:
Quote:
{foreach from=$products item=product name=myproducts}
{$smarty.foreach.myproducts.index}
{/foreach}
|
Be warned that some of this is on the fringe of needing to be done in PHP. Smarty is a template engine used for presentation of data. Using it to perform logical operations is against the principles behind smarty. (purist nonsense to some)
Are you perhaps trying to determine how many of a certain product they bought? Then you would use {$product.amount}