View Single Post
  #72  
Old 01-03-2005, 08:25 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

M&M's AND Girls. I am a trader by nature and bartering is the "original" way of doing business.

Code:
<TD {include file="main/orders_colors.tpl"}>

see that? It's like one or two lines from the top of my posted code (assuming you are doing 4.0).

That would be a regular <TD> but we added the call to include the code from orders_colors.tpl.

Well what happens when we add the code from orders_colors.tpl?

Code:
{* $Id: orders_colors.tpl,v 2.0 2004/10/31 01:27:28 ADPBoss Exp $ *} {if $orders[oid].status eq "C"} bgcolor="#00CCFF"} {/if} {if $orders[oid].status eq "P"} bgcolor="#00FF66"} {/if} {if $orders[oid].status eq "Q"} bgcolor="#FFFF99"} {/if} {if $orders[oid].status eq "F"} bgcolor="#FF3333"} {/if} {if $orders[oid].status eq "I"} bgcolor="#CCCCCC"} {/if}

So if the order has a status of "C" for complete, the following Smarty

Code:
<TD {include file="main/orders_colors.tpl"}>

will become

Code:
<TD bgcolor="#00CCFF">

when the template is generated. Note the background colour of the cell is Hex #00CCFF which is a very nice blue.
Reply With Quote