I am running a loop to determine the quantity of items in the cart. Later I want to out put the total items in the cart. As your cart contains 10 items totalling $10.00. When I outout the results, obviously I am getting the your cart contains line for each set of items. how can I determinr the total number of items added together and out put them?
Code:
<cfloop collection="#session.cart#" item="i">
<cfset subtotal = subtotal + (session.cart[i][4] * session.cart[i][3])>
<form method="post">
Your Cart Contains
#session.cart[i][4]# <cfif #session.cart[i][4]# EQ 1> item,<cfelse>items,</cfif>
</cfloop>
#session.cart[4]# is the quantity of each item choosen DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic