View Single Post
  #14  
Old 09-26-2012, 09:27 PM
 
Pyro Pyro is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 506
 

Default Re: Customize invoice based on product purchased

Sorry Mike, one more question for you about the variables.


Does everything have to be defined?

I used {$order|@print_r} to print the variables and I see nothing related to count.


I guess what I am asking is can I count the number of each SKU and use that number in a basic math problem?


Here is an example of the logic that I am thinking:

HTML Code:
{foreach from=$products item=product} {if $product.productid eq 8} {assign var=count8 value=(count($product.productid eq 8))} {/if} {if $product.productid eq 2} {assign var=count7 value=(count($product.productid eq 7))} {/if} {/foreach} {if $count8 ne '' and $count7 ne ''} Text[{$count7}*17]+[{$count8}*27] {elseif $count7 ne ''} Text{$count7}*17 {elseif $count8 ne ''} Text{$count8}*27 {else} Go get a boat, and some $*%# life jackets, loser! {/if}


(Just incase I randomly became a genius at this in 4 posts, I checked to see if my attempt at pseudo code worked. Its safe to say it didn't for those of you that may try it in the future. )
__________________
Best Wishes,
James

4.5.2 Gold (work in progress)
Reply With Quote