Without seeing more I can't offer much in the way of specific advice, but
this approach seems like it could be refactored or changed in some way to
make it less confusing and less dependent on the "magic numbers" 8 and 22.
My initial take on this is that if you or anyone else has to maintain this
later it's going to be difficult to figure out what is going on. If you care
to post more you might get some additional feedback on the approach as a
whole.
Regards,

Brian


On Mon, Sep 8, 2008 at 3:54 PM, Jeff F <[EMAIL PROTECTED]> wrote:

> I've got a simple cart that stores items in an array.
>
> I keep a running total of the items in the cart looping through:
>
> <cfloop collection="#session.cart#" item="i">
> <cfset numberofitems  =  numberofitems  + session.cart[i][4]>
> </cfloop>
>
> 4 is quantity of that item in the array.
>
> What I'd need is to have a running total of items, that does not include a
> certain item, based on the 8th element of the array where I store
> "category".
>
> Something like:
>
> <cfloop collection="#session.cart#" item="i">
> <cfset numberofitems  =  numberofitems  + session.cart[i][4] where
> session.cart[8} is not 22>
> </cfloop>
>
> Is there a way to do this? I need a boost!
>
> -jeff
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312208
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to