Advertisement
Advertisement
| 02.29.2008 at 09:22AM PST, ID: 23204372 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: |
<cfif IsDefined('FORM.Update.y')>
<cfset numberOfItems = "#ArrayLen(Session.Cart.ItemID)#">
<cfloop from="1" to="#numberOfItems#" index="ThisItem">
<cfset Session.Cart.Qty[ThisItem] = form["Qty" & ThisItem]>
</cfloop>
</cfif>
cfset ordertotal = 0>
<cfloop from="1" to="#ArrayLen(Session.Cart.ItemID)#" index="ThisItem">
<cfoutput>
<cfquery name="getItem" datasource="#DSN#">
SELECT items.itemPrice
,items.itemID
,items.itemName
,items.CategoryID
,category.CategoryImageSmall
,category.CategoryID
FROM items, category
WHERE items.itemID = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#Session.Cart.ItemID[ThisItem]#">
AND category.CategoryID = items.CategoryID
</cfquery>
<cfset total = 0>
<cfset total = total + (getItem.itemPrice * Session.Cart.Qty[ThisItem]) >
<tr>
<td><img src="/images/#Session.Cart.CategoryImageSmall[ThisItem]#" alt="#Session.Cart.ItemName[ThisItem]#"/></td>
<td>#Session.Cart.ItemName[ThisItem]#</td>
<td><input name="ItemID#ThisItem#" type="hidden" value="#Session.Cart.ItemID[ThisItem]#" />
<input class="quantity" name="Qty#ThisItem#" type="text" value="#Session.Cart.Qty[ThisItem]#" />
<br />
<a class="removeItem" href="#CGI.SCRIPT_NAME#?id=#ThisItem#">x remove</a>
<input name="ItemName#ThisItem#" type="hidden" value="#Session.Cart.ItemName[ThisItem]#" />
<input name="CategoryImageSmall#ThisItem#" type="hidden" value="#Session.Cart.CategoryImageSmall[ThisItem]#" />
</td>
<td>#LSCurrencyFormat(total,'local')#</td>
</tr>
</cfoutput>
<!---Create row for total--->
<cfset ordertotal = ordertotal + total + Shipping>
</cfloop>
<tr>
<td colspan="2" class="total"><input name="Update" type="image" src="/images/update-basket_lrg.gif" alt="Update Basket" />
<!---Clear Basket Button, first make sure there is nothing in the basket--->
<cfif ordertotal EQ 0>
<cfelse>
<a href="<cfoutput>#CGI.SCRIPT_NAME#?basket=clear</cfoutput>"> <img border="0" src="/images/clear_basket_lrg.gif" alt="Clear Basket" /> </a>
</cfif>
</td>
<td>
Shipping and Handling: <br />
Total:
</td>
<td>
$6.00<br />
<cfoutput>#LSCurrencyFormat(ordertotal,'local')#</cfoutput>
</td>
</tr>
</tbody>
</table>
</form>
|