Mike,
Thanks! That definitely helped as it is now displaying a number at least!
On an invoice that has 5 of product#7 and 1 of product#6, the output is 18. (which is the output of the 1 product#6.)
It seems the issue is the or statement. It is not combining the count of each of the products in the or, but rather 1 of them.
It seems that I should switch which side of the equation the or is on.
This is my attempt, which only outputs "text" for an order with 5 product#7 and 1 product#6.
HTML Code:
{foreach from=$products item=product}
{if $product.productid eq 1}
{assign var=ordered1 value=$product.amount}
{/if}
{if $product.productid eq 5}
{assign var=ordered5 value=$product.amount}
{/if}
{if $product.productid eq 6}
{assign var=ordered6 value=$product.amount}
{/if}
{if $product.productid eq 7}
{assign var=ordered7 value=$product.amount}
{/if}
{/foreach}
{if $ordered1 ne '' or $ordered5 ne '' or $ordered6 ne '' or $ordered7 ne ''}
text{math equation="(( w * 9 ) + ( z * 18 ) + ( y * 18 ) + ( z * 18 ))" w=$ordered1 x=$orderedz5 y=$ordered6 z=$ordered7}
{else}
Go get a boat, and some $*%# life jackets, loser!
{/if}